Font size in text boxes on PDF form

I am using the PDF.Kit to fill in a form with data from a database, using the autofiller.

autoFiller.ImportDataTable(ds.Tables(0))

That line saves a lot of coding! Everything works great, except that the font size of the resulting data is very small. If you open the PDF in Acro reader you can type in the text boxes and the font size is normal. But when you do the import, everything is small. Why is this happening? What can I do to prevent this?

I have question in to the original form designer to see how the set up the text boxes, but I don't see why the import would be any different than the font used when typing on screen.

Thanks

Hi Ed,

Thank you very much for considering Aspose.

Please share the sample PDF file with us, so we could test the issue at our end.

We're sorry for the inconvenience.

Regards,

OK. Is there an address where I can email it to you? My client would probably not want me to post it to this board.

Thanks.

Hi Ed,

You can attach the PDF file with your post, and mark the post as private. This way the file will be accessible only by the Aspose staff and no one else.

It'll also be convenient if you could share the code snippet and related stuff for filling the data. This will help us recreate the scenario at our end.

We appreciate your patience and cooperation.

Regards,

I found that the fields on the PDF form had their text property set to Auto, versus a number. I had them change a few fields to 10pt, and then they looked like we expected. So they can change all fields to 10pt and it won't be a problem.

My only question is why there would be a difference in the font size when using code and when you fill in the fields manually in Acrobat Reader? That wasn't expected behaviour.

The code is like this:

Private Sub AutoFill(ByVal S As MemoryStream, ByVal FilePath As String, ByVal StoredProc As String)

Dim autoFiller As AutoFiller = New AutoFiller()

Dim ds As DataSet

autoFiller.InputFileName = FilePath

autoFiller.OutputStream = S

'get a datatable

ds = SqlHelper.ExecuteDataset(connstr, CommandType.StoredProcedure, StoredProc, New SqlClient.SqlParameter("Main_FormID", formID))

autoFiller.ImportDataTable(ds.Tables(0))

autoFiller.Save()

lstOutStreams.Add(S)

End Sub

Dear Ed,

Sorry for my late reply.

Since we do not get the resource files, the problem cannot be reproduced entirely on my end. However, the problem of font size can be explained. Each field should have a font number. If it is set to "Auto", let's compare the two cases when using code and when you fill in the fields manually in Acrobat Reader.

1. Using code
Aspose.Pdf.Kit will set the font size to 10pt by default.

2. Filling fields in Acrobat Reader
The actual size will be adjusted automatically according to the ratio of the number of characters and the length of the field.

Therefore, they will return different results.

Honestly, adjusting font size of "Auto" fields according to the ratio is not included in our near future plan. However, if the requirement is very important to your task, we will consider this feature seriously.

Sorry for the inconvenience & Best regards.

Thanks for the reply.

I don't think you should add a new feature for this. It isn't that difficult to have the client change the fields to an exact number. I think that is better anyway so we know exactly what the results will look like.

The only thing you might look in to is that when we use the Kit, the font isn't actually 10pt, but smaller.

Dear Ed,

Thanks for sending your resource file to me. This problem has been reproduced on my platform. It will be solved in one week and expected to be included in the next release.

Best regards.

Dear Ed,

Please try the trial version at: http://www.aspose.com/community/forums/2/164254/pdf-merge-multiple-fields-with-same-name/showthread.aspx. The final version will be released soon.

Best regards.

The issues you have found earlier (filed as 8460) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi lukeyoyo,


2. Filling fields in Acrobat Reader
The actual size will be adjusted automatically according to the ratio of the number of characters and the length of the field.

The above statement of your’s solved my problem (mypost: Actual font size of vertical formfield(Adobe Professional) is not applied).—Current User is not admin (for 250463)

Thanks lukeyoyo…

Hi Rajesh,


We are glad to hear that you problem is resolved. Please continue using our API’s and in the event of any further query, please feel free to contact.