Hi,
I am using the CreateLabel() method to fill Form fields in a PDF Document. One of the form fields is quite bid and it will have number of pieces of information like address1, address2, address3, town,county,postcode. When using the CreateLabel method to fill this single form field I have tried to insert both Carriage Return and Line Feed characters between the text so that the text can move to next line. However all the text for the Address Field is still being displayed in a single line. Can you please let me know how can this be done.
How to add a Linefeed in AcroForm Field
Re: How to add a Linefeed in AcroForm Field
Support · Aug 21, 2009Hello,
You can use the "\n" character for the new line in the CreateLabel method without any problem. Please make sure that you are using a correct code. Below is a sample code for this. If you are still having a problem then please send over the PDF and the code you are using to our [^a|mailto:support@cete.com|Support Team^] so that they can look into it further.
PdfDocument pdf = new PdfDocument(@"C:\Temp\Doc.pdf");
MergeDocument document = new MergeDocument(pdf);
PdfFormField field = pdf.Form.Fields["fieldName"];
pdf.Form.Fields["fieldName"].CreateLabel(document.Pages[field.GetOriginalPageNumber() - 1], "ceTe \n Software", Font.Courier, 12);
document.Draw(@"C:\Temp\New.pdf");
Thanks,
ceTe Software Support Team.