Hi,
We are using the latest version (6.0.0) of ASPOSE.pdf.
we are using the FACADES namespace to merge the fdf and pdf data.
All the code to merge and contatenate is placed in a web service and are being used by the web application.
we are resulting in an error with the following stack trace
Error happened during parsing at .?.a(Int32 startPosition, Int32& endPosition)
at ..()
at ?..a()
at ?..(? fontDefinition)
at ?..(String standardFontName)
at ..a()
at ..()
at Aspose.Pdf.Text.Font.a( trailerable, iPdfFont)
at Aspose.Pdf.Text.FontCollection..ctor( fontsDictionary)
at Aspose.Pdf.Resources..ctor(Object parent)
at Aspose.Pdf.XForm.get_Resources()
at Aspose.Pdf.InteractiveFeatures.Forms.TextBoxField.createAppearanceProgram(AppearanceParameters parameters, Annotation annotation)
at Aspose.Pdf.InteractiveFeatures.Annotations.WidgetAnnotation.a(Annotation annotation)
at Aspose.Pdf.InteractiveFeatures.Forms.Field.a()
at Aspose.Pdf.InteractiveFeatures.Forms.Field.setValue(String value)
at Aspose.Pdf.InteractiveFeatures.Forms.TextBoxField.set_Value(String value)
at Aspose.Pdf.Facades.Form.a(? source, ICollection dest, String xfaPath)
at Aspose.Pdf.Facades.Form.ImportFdf(Stream inputFdfStream)
We observe that this problem occurs only when the compilation debug mode of the services holding all these code is set to "Release". And the problems do not occur when the debug mode is set "Debug" and we are able to produce the pdf successfully after merging using ASPOSE.
Following is the code snippet of our code that users
//use Aspose to generte PDF from PDFImage and FDF_PDF
Stream[] fdf_pdfStream = new MemoryStream[pagecount];
pdfImage = (byte[])DetailRow["PDFImage"];
for (int count = 0; count < pagecount; count++)
{
Stream pdfImageStream = new MemoryStream(pdfImage);
DetailRow = Details.Tables[0].Rows[count];
fdf_pdf = (byte[])DetailRow["FDF_PDF"];
fdf_pdfStream[count] = new MemoryStream(fdf_pdf);
abcPDFStream[count] = new MemoryStream();
//2. Create Aspose Form instance with input stream and destination stream
Form pdfForm = new Form(pdfImageStream, abcPDFStream[count]);
//3. Import the contents of the fields in PDF template from the fdf_pdf byte[] and put them into new PDF stream abcPDFStream.
pdfForm.ImportFdf(fdf_pdfStream[count]);
pdfForm.Save();
//4. Retrieve byte[] from generated PDF stream (abcPDFStream)
abcPDFStream[count].Seek(0, SeekOrigin.Begin);
}
for (int count = 0; count < pagecount; count++)
{
fdf_pdfStream[count].Dispose();
fdf_pdfStream[count].Close();
}
}
PdfFileEditor pdfEditor = new PdfFileEditor();
using (Stream abcPDFoutputStream = new MemoryStream())
{
pdfEditor.Concatenate(abcPDFStream, abcPDFoutputStream);
abcPDFoutputStream.Seek(0, SeekOrigin.Begin);
abcPDF = new byte[(int)abcPDFoutputStream.Length];
abcPDFoutputStream.Read(abcPDF, 0, (int)abcPDFoutputStream.Length);
}
for (int count = 0; count < pagecount; count++)
{
abcPDFStream[count].Close();
}
return abcPDF;
Can you please work on this.