I have template PDF with Acro Forms fields which I need to fill. After that I want to create PDF/A file from this document.
But to do that, I am required to embed fonts to pdf file. I have these fonts, but how can I embed it? Since I don't add any Label to document, I can't use ceTe.DynamicPDF.Text.OpenTypeFont.Embed property.
PDF/A font embed
Re: PDF/A font embed
Support · Apr 8, 2015Hello,
If the template PDF is not PDF/A compliant then it is not possible to create a PDF/A compliant document using Merger. With our product you can add new content that is PDF/A compliant to an existing PDF/A document and preserve its PDF/A compliance or create a new PDF/A compliant document from scratch. Please refer to the documentation on this topic http://www.dynamicpdf.com/Support/NET_Help_Library_15_01/PDFA.html.
Regarding embedding the font while filling form fields, you can actually assign an OpenTypeFont object to the form field itself as shown below:
OpenTypeFont otfFont = new OpenTypeFont(@"Path for TTF or OTF font file");
otfFont.Embed = true;
otfFont.Subset = false;
PdfDocument pdf = new PdfDocument(@"path for the input PDF");
MergeDocument document = new MergeDocument(pdf);
document.Form.Fields["form field name"].Font = otfFont;
document.Form.Fields["form field name"].Value = "ceTe Software";
document.Draw(@"C:\Temp\MyDocument.pdf");
Thanks,
ceTe Software Support Team.
Re: PDF/A font embed
Forum member · May 12, 2015Thank you for answer. At the end I resigned to font embedding since we use Helvetica font which should be pretty common and embedded fonts makes final pdf file much bigger.
Right now I am having another issue. I have PDF documents with Acro form fields which I need to populate with UTF8 strings (like "ěčřžýé"). Problem is, that some of these characters are not displayed - for example when value "ĚŠČŘŽÝÁÍÚŮ" is assinged to field, only "ÝÁÍÚ" string is visible.
However if I click into field to edit its value, the whole string appears suddenly.
When I try to populate Acro fields in Adobe reader, everything works as supposed.
Do I have to specify encoding for fields somehow?
Re: PDF/A font embed
Support · May 12, 2015Hello,
Yes, increase in the output PDF file after embedding the font fully by setting the Embed property to true and Subset property to false is expected behavior as the whole font is added to the PDF.
Can you please send over the following details to [^a|mailto:support@cete.com|opennewwindow|support@cete.com^] so that we can look into it further?
1.Code sample using which we can recreate the behavior.
2.Exact version and build number of the DynamicPDF DLL file. You can get this information in DL references properties (Version and Description fields) in Visual Studio.
3.Input PDF used for merging and filling.
4.Font file used.
5.Output PDF.
6.Name and version of the PDF reader used to view the PDF.
Thanks,
ceTe Software Support Team.