Free Support Forum - aspose.com

Import xls data to PDF

Hi

My company is Messaging Company.We do Mail merging and brodcasting.I have a PDF and an XLS file.I want to import some data fields from XLS to the existing PDFand save the output file as another PDF dcoument.Which is just like MAil Merging with Word.

IS this product suitable for my application.

xls look like

Name Number Message

xxx 1234 hello

yyy 2345 test

PDF looks like

Hello <>

Your Number is <>

You Have a Message <>

XXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXX

Now output File should look like

Hello XXX

Your Number is 1234

You Have a Message Hello

XXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXX

Hi,

Thank you for considering Aspose.

This task can be completed by ReplaceText method of PdfContentEditor class in Aspose.Pdf.Kit.

PdfContentEditor editor = new PdfContentEditor();
editor.BindPdf(inputPath + "text.pdf");
editor.ReplaceText("<>", "Adeel");
editor.Save(outputPath + "replace.pdf");

Thanks.

Hi,

In addition to Adeel's suggestion, an alternative way is to use AutoFiller method. Please have a look at our demo, where the similar work of mail filling is achieved by the demo named "Northwind".

Thanks,