Hi Maruan,
Thank you for your reply. I am using PDFBox1.8.8. I am really not using any 
formatting related code. I am just sending data to a PDF. I'll talk to my 
client about sharing the file.
This is a sample code of a class I have been using for testing purposes. It 
works great as long as the field on the PDF is Helvetica size 12
PDChoiceField field3 = (PDChoiceField) acroForm.getField( "Tu3" 
);field3.setValue("Deleted");
PDTextbox field11 = (PDTextbox) acroForm.getField( "ex1" );
field11.setValue("Bad");
PDTextbox field4 = (PDTextbox) acroForm.getField( "$$1" );
field4.setValue("$2000");
PDTextbox field5 = (PDTextbox) acroForm.getField( "$$2" );
field5.setValue("$5000");
PDTextbox field6 = (PDTextbox) acroForm.getField( "ACC_ty3" 
);field6.setValue("CBNM");PDTextbox field7 = (PDTextbox) acroForm.getField( 
"ACC_ty5" );field7.setValue("VBSH");   PDTextbox field8 = (PDTextbox) 
acroForm.getField( "Clients Name" );    if (field8 != null)
           field8.setValue("John Bytheway");PDTextbox field9 = (PDTextbox) 
acroForm.getField( "Address 1" );field9.setValue("2000 Wolf Cr.");   PDTextbox 
field10 = (PDTextbox) acroForm.getField( "Date2" );        if (field10 != null) 
                     field10.setValue("January 2, 2015");

Maybe I need to update the fields and format them according to the client's 
wishes.  This is my first time using PDFBox. I thought that by sending data to 
x field it would get just inherit the attributes of it. That could be the 
problem. Helvetica could be a default attribute and when data is sent to a 
field with fancier formatting it doesn't like it. hmmm.
Thanks for your help.
Lorena       From: Maruan Sahyoun <[email protected]>
 To: [email protected]; Lorena Leishman <[email protected]> 
 Sent: Thursday, February 19, 2015 4:29 PM
 Subject: Re: PDAppearance.calculateFontSize, PDAppearance.setAppearanceValue
   
could you upload a sample file to a public location for inspection? What if the 
field uses e.g. Arial TrueType?

Which version of PDFBox are you using?

BR
Maruan



Am 19.02.2015 um 19:46 schrieb Lorena Leishman 
<[email protected]>:

> Hello everyone,
> I am having some error messages when I am trying to set values to some fields 
> in a PDF form. Many of the values are set fine but then I get these error for 
> some fields.
>  
>java.lang.NullPointerExceptionpdmodel.interactive.form.PDAppearance.calculateFontSize
> pdmodel.interactive.form.PDAppearance.setAppearanceValue
> 
> I noticed that the fields that get updated have font size = 12 and font type 
> Helvetica. If I manually go to the file and change the fields that are not 
> being updated to size =12, font type Helvetica then it works!!
> I can not have all the fields be the same size and font type. Is there a way 
> to get around this? and why do I have this problem in first place?
> Any help would be appreciated. Thanks! 


  

Reply via email to