pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eli colner <ecol...@yahoo.com>
Subject Changing font of PDTextbox
Date Wed, 05 Mar 2014 22:08:41 GMT
How is it possible to change the font of a textbox?

I tried 

PDDocument pdf = PDDocument.load(originalPdf);
PDDocumentCatalog docCatalog = pdf.getDocumentCatalog();
PDAcroForm acroForm = docCatalog.getAcroForm();
PDField field = acroForm.getField( "topmostSubform[0].Page1[0].Entity[0].p1-t4[0]" );
field.getDictionary().setString(COSName.DA, PDType1Font.COURIER.getBaseFont());
field.setValue("Testing font change");

I also searched for the answer to this and couldn't figure it out.

Any help would be much appreciated.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message