I have a PDF template with some MergeTextField with blank values. Whenever I generate the PDF I fill in the MergeTextField values and generate the PDF. But I do not found anything through which I can Control the Font of the MergeTextFields.
Is it possible anyway?
Font MergeTextField
Re: Font MergeTextField
Support · Aug 3, 2006Hello,
It is not possible to set the Font for the text while filling an existing form field directly by specifying the value. The text will be displayed in the same font that was set at the time of creating the form field.
A workaround would be flattening the form fields using the CreateLabel method off the PdfFormField object and you can add text with desired font, but the form fields will be flattened. Following is the link to the Help Documentation on our web site that shows use of CreateLabel method
.
Thanks,
ceTe Software Support Team
Re: Font MergeTextField
Forum member · Aug 3, 2006Thanks a lot for your early reply.
Re: Font MergeTextField
Forum member · Aug 3, 2006For Implementing the CreateLabel method I need to know the position of the MergeTextFields in the Template File. But unluckily i do not find the position of those fields.
Morever if I get to know the setted Font information of the fields of Template document then also my purpose will meet.
Please help me in this regard.
Re: Font MergeTextField
Support · Aug 3, 2006Hello,
It is not necessary to know the position of the form fields, in order to use the CreateLabel method. This method is available on all individual form fields which you can access with the name of the form field. The following code will show you how to use this method.
VB.NET Code:
MyPdfDocument.Form.Fields( "f1-1" ).CreateLabel( MyPage, "Acme Corp.", ceTe.DynamicPDF.Font.Courier, 12 )
C#.NET Code:
pdfDocument.Form.Fields["f1-1"].CreateLabel( page, "Acme Corp.", ceTe.DynamicPDF.Font.Courier, 12 );
You can get the fields X and Y coordinates using the GetX and GetY methods of the PdfFormField class which will return the X and Y positions of the form field. To use this you have to take a PdfDocument object and from this you can access the fields and get the X, Y coordinates.
Thanks,
ceTe Software Support Team