Generate invoce

Hello I need to generate invoice based on the parameters from the database.

in your ReplaceText example

We are searching for 1 parameter and replacing with new parameter.
How do I need to replace several parameters like([Full_Name], [Company_Name], [Invoce_Number], …)

Thank you

I found reference to PdfContentEditor which let me do what i need.

Thank you!

Hi there,


Thanks for your inquiry. Please check following code snippet to replace several words in a PDF document. Hopefully it will help you to accomplish your requirements.

PdfContentEditor
pdfContentEditor = new PdfContentEditor(doc);<o:p></o:p>

pdfContentEditor.BindPdf(myDir+"input.pdf");

pdfContentEditor.ReplaceTextStrategy.ReplaceScope = ReplaceTextStrategy.Scope.REPLACE_ALL;

pdfContentEditor.ReplaceText("<>", DateTime.Now.ToShortDateString());

pdfContentEditor.ReplaceText("<>", "John");

pdfContentEditor.ReplaceText("<>", "Berry");

pdfContentEditor.ReplaceText("<>", "F-12, 31/6");

pdfContentEditor.ReplaceText("<>", "HB Colony, CS Pur");

pdfContentEditor.ReplaceText("<>", "NY City");

pdfContentEditor.ReplaceText("<>", "NY");

pdfContentEditor.ReplaceText("<>", "631016");

pdfContentEditor.ReplaceText("<>", "0316");

pdfContentEditor.ReplaceText("<>", "Canada");

//save output PDF

pdfContentEditor.Save(myDir + "Modified.pdf");


Please feel free to contact us for any further assistance.


Best Regards,