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.
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.
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))
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.
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.
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.
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)
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.