Free Support Forum - aspose.com

Missing tetxt fields

Hi, I tested the Aspose.Pdf.Kit.Form and Aspose.Pdf.Kit.PdfFileEditor.
Why text fields is missing in marged pdf ?

//////////////////////////////////////////////
string basepdf = “normal.pdf”;
string templatepdf = “bmsp008_21.pdf”; // with some text fields
string outpdf = “out21.pdf”;
string template2pdf = “out22.pdf”;
string dumypdf = “dumy.pdf”;


Aspose.Pdf.Kit.Form pdfa = new Aspose.Pdf.Kit.Form(templatepdf, dumypdf);
int len = pdfa.FieldsNames.Length; // len > 0

// marge template pdf
Aspose.Pdf.Kit.PdfFileEditor pdfEditor = new PdfFileEditor();
pdfEditor.Append(basepdf,templatepdf,1,1, template2pdf); // template2pdf = basepdf + templatepdf

// missing tetxt fields.
Aspose.Pdf.Kit.Form pdf = new Aspose.Pdf.Kit.Form(template2pdf, outpdf);
len = pdf.FieldsNames.Length; // len == 0 , Where is text fields?

Dear ,

The append method will miss the acroform with unflanttened fields, because the page object doesn’t contain the acroform object. if you want to merge two Pdf files, the concatenate method is an alternative.

The snippet code can be:

string basepdf = “normal.pdf”;
string templatepdf = “bmsp008_21.pdf”; // with some text fields
string outpdf = “out21.pdf”;
string template2pdf = “out22.pdf”;
string dumypdf = “dumy.pdf”;


Aspose.Pdf.Kit.Form pdfa = new Aspose.Pdf.Kit.Form(templatepdf, dumypdf);
int len = pdfa.FieldsNames.Length; // len > 0


// marge template pdf
Aspose.Pdf.Kit.PdfFileEditor pdfEditor = new PdfFileEditor();

//Concatenate replaces Append
pdfEditor.Concatenate(basepdf,templatepdf,“newtemplate.pdf”)// template2pdf = basepdf + templatepdf

Aspose.Pdf.Kit.Form pdf = new Aspose.Pdf.Kit.Form(“newtemplate.pdf”, outpdf);
len = pdf.FieldsNames.Length;

Hi,
Thank you for quick replay.
I tested Concatenate function in and not found problem.