Error Generating PDF document with Aspose.PDF.Kit

I have been using Aspose.PDF.Kit to generate PDF’s and merge data into PDF fields. See code below:


SetAsposeLicense();

using (MemoryStream tempStream = new MemoryStream())
{

// Load input file to Pdf Kit form object
Kit.Form PdfForm = new Kit.Form(renderingInfo.DocumentTemplateFilePath, tempStream);

InsertDataIntoPdf(PdfForm, renderingInfo.DocumentFields);

using (MemoryStream outputPdfStream = CreateOutputFileFromTemplate(tempStream))
{
StreamFileToClient(outputPdfStream, renderingInfo.CustomDocumentName);
}

I have recently started getting the following error: Read pdf error:Trailer object is null.: v4.1.0.0

On examining the stack trace, the error is thrown in the constructor of the pdf form.

We have recently upgraded our websites from vs 2005 to vs 2008, and moved from .Net 2.0 to .Net 3.5 - could that have caused the problem?

I have looked at this issue on your forums: http://www.aspose.com/community/forums/190955/pdf-kit-concatenate-fails-trailer-object-is-null/showthread.aspx#190955 however the version of PDF.Kit that I have installed is more recent than the October 2009 fix release date. It also appears to be a slightly different error / usage case.

I can find no further information regarding the Trailer object.

Any information would be greatly appreciated.




Hi,

Can you please try the latest version (4.6.0) at your end? If it doesn’t resolve your issue then please share a sample problematic PDF file with us, so we could test the issue at our end. You’ll be updated with the results accordingly.

We’re sorry for the inconvenience.
Regards,

I have managed to fix this issue - It looks like the pdf templates we were using had become corrupted. I have overwritten them with the original templates and it is working again.


Thank you for the help.