I am evaluating DynamicPDF but seem to have a problem with form filling. My template pdf has an embedded font and a number of form fields utilising said font. When I populate the fields using DynamicPDF the resulting output shows the fields in Helvetica font and not the required embedded font.
I am using v6 which looks like it is supposed to support the getting of font and alignment information from an existing form field but it doesn't seem to be working for me. The returned font is always Helvetica.
Can you confirm whether v6 supports what I am trying to achieve and if it does could you provide some sample code please?
Form Field Fonts
Re: Form Field Fonts
Support · May 24, 2010Hello,
Yes, you can get the font information of the existing form fields using the v6 of our product and then you can use that font to the new fields creating in the document. Below is a sample code for this.
PdfDocument pdf = new PdfDocument(@"C:\Temp\Test.pdf");
MergeDocument document = new MergeDocument(pdf);
ceTe.DynamicPDF.Font font = pdf.Form.Fields["FieldName"].Font;
TextField newField = new TextField("newField", 10, 200, 200, 20);
newField.Font = font;
newField.DefaultValue = "new value";
document.Pages[0].Elements.Add(newField);
document.Draw(@"C:\Temp\output.pdf");
Thanks,
ceTe Software Support Team.
Re: Form Field Fonts
Forum member · May 24, 2010Thanks for replying so quickly and for the sample code - but it still returns Helvetica as the font. I'm wondering if perhaps my source pdf is at fault or if this is a bug? I have a blank single page pdf document which I've then opened with Adobe Designer and added a single Text Field.
I edited the Text Field font to "Boopee" (i.e. anything other than Helvetica) and set its caption to "None" and then saved it as "C:\Temp\Test.pdf".
When I run your code it detects the Font as type "ceTe.DynamicPDF.Text.Helvetica". I've tried different variations and noted that in order for the "Boopee" font to be embedded in the Test.pdf in the first place the caption must be set - but even this returns a Helvetica font.
Is it a bug or am I doing something wrong?
Thanks in advance,
Andrew.
Re: Form Field Fonts
Support · May 25, 2010Hello Andrew,
Can you please send over the PDF document, font file and the code you are using to our [^a|mailto:support@cete.com|opennewwindow|Support Team^]
so that they can look into it further?
Thanks,
ceTe Software Support Team
Re: Form Field Fonts
Support · May 25, 2010Hello Andrew,
Can you please send over the PDF document, font file and the code you are using to our [^a|mailto:support@cete.com|opennewwindow|Support Team^]
so that they can look into it further?
Thanks,
ceTe Software Support Team
Re: Form Field Fonts
Forum member · May 25, 2010I've emailed sample code and pdf as requested.
Regards,
Andrew.