So format your PDF form field thus...:
... and you'll be able to reference your field and add line breaks thus:
PdfReader reader = null;
AcroFields af = null;
PdfStamper ps = null;
reader = new PdfReader(new RandomAccessFileOrArray(Request.MapPath(@"~/App_Data/your_pdf_document.pdf")), null);
ps = new PdfStamper(reader, stream);
AcroFields af = ps.AcroFields;
af.SetField("Your PDF form field name", @"This line is " + System.Environment.Newline + "broken");
// make resultant PDF read-only for end-user
ps.FormFlattening = true;
// forget to close() PdfStamper, you end up with
// a corrupted file!
ps.Close();
That's all there is to it.
Hope this helps you in your further career. And good luck with it, too!
Buy me a coffee
Ingen kommentarer:
Send en kommentar