views:

1920

answers:

1

I have a pdf that has been created using the Foxit form designer. On my design system, I have the barcode font installed. The barcode font is used in one of the AcroFields. It appears that foxit does not embed the font in the document.

I also have customers that do not have the barcode font installed in their computers, and thus I would like to embed the font into the PDF. Is there a way for me to embed a font that is used in the AcroFields into the PDF using iText?

EDIT: The font seems to be included in the text, but not the fields, Therefore the font(barcode) will not print.

+1  A: 
PdfContentByte ab = yourPDFWriter.getDirectContent();
// field: PdfFormField.createTextField(...);
PdfAppearance ap = ab.createAppearance(320, 30); // size of field
field.setDefaultAppearanceString(ap);

That should do the trick.

Pindatjuh