Welcome Guest Search | Active Topics | Sign In | Register

Generated PDF not properly using embedded font Options
Grant Hawkes
Posted: Friday, April 27, 2018 1:05:34 PM
Rank: Member
Groups: Member

Joined: 4/27/2018
Posts: 17
We are experiencing a couple different issues when using a PDF form.

We have a couple different fields that are filled in using C# on a server that have a specified font of Calibri Bold, size 10. I've checked in the Preflight to make sure that the font is indeed embedded. But when the PDF is generated and serialized down to the client, the font is not being rendered correctly and, as such, appears to be defaulting back to another font. Opening up the saved PDF in Acrobat DC and checking the field properties, I can see that the font on the field is now listed as "YASUIG+Calibri,Bold Bold" instead of the "Calibri Bold" that was specified when the form was created.

Additionally, on the same form, we have fields that are specified as Center alignment. But, again, after inserting the data in the form and serializing it down to the client, the fields all Left align, despite still having the alignment set as Center in the PDF properties.

Is there anything in particular that needs to be set in the Form when it's created?

For reference, we are using Save(Stream) method of the PdfDocument class to serialize the PDF to a byte array and send it down to the client.
eo_support
Posted: Friday, April 27, 2018 2:18:10 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

Please download the latest build and see if it help you resolve the issue. We have made a number of improvements on this issue in very recent builds. Below is a more detailed explanation of the problem for your information.

PDF uses a so called "font subsetting" process to embed font data. This is because it is usually not possible to embed all characters of a font as some fonts contain tens of thousands characters and the whole font file is quite large. For this reason, typically when you choose to embed font, only data for those characters that are actually used in the PDF file is embedded in the PDF file. So if the font that you choose contains character data for 1000 characters but you only use 10 in your PDF file, then only data for those 10 characters are embedded in the file. This is the difference between "Calibri Bold" and "YASUIG+Calibri,Bold Bold". Here "YASUIG" is a unique subset ID in the file.

The font subsetting works fine for regular text in a PDF file because all the characther are already known. You will run into problems for PDF fields because you can set the value to "abc" (thus the embedded font subset only contains data for "abc") and user can later change it to "def". Since there are no font data for "def" in the file, those user entered characters may not display correctly. The recommended way to avoid such issue is to use the built-in fonts --- all PDF Viewers are required to be able to correctly render those fonts even if there is no font data in the file.

It is possible that the original PDF file has already included font data for commonly used characters (for example, then entire ISO 8859-1 charset). Our old version will discard them and only keep whats used. This issue has been addressed in the latest build. In the latest build it will keep the original font data thus may resolve the issue for you.

I do not believe we support alignment options for PDF field. If you can send a test file to us we will be happy to look into it and see what we can do. See here for more information on sending test files to us:

https://www.essentialobjects.com/forum/test_project.aspx

Please feel free to let us know if you still have any questions.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.