We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

PDF Merge throwing error?.

Hello,

we were using 17.1400.0.38, when we do a merge to the multiple pdf document into a single documents, i am getting below error message. the same we were able to do it in 15.1.0.33. we are facing lot of mismatches between 15 and 17 versions. 
when we do merge we were getting below error message.

System.NullReferenceException: Object reference not set to an instance of an object.

   at Syncfusion.Pdf.IO.PdfStructTreeRoot.Add(PdfStructureElement structElement, PdfPageBase page, PdfDictionary annotDictionary)
   at Syncfusion.Pdf.Interactive.PdfFieldCollection.DoAdd(PdfField field)
   at Syncfusion.Pdf.Parsing.PdfLoadedFormFieldCollection.DoAdd(PdfField field)
   at Syncfusion.Pdf.Parsing.PdfLoadedFormFieldCollection.CreateFormFieldsFromWidgets(Int32 startFormFieldIndex)
   at Syncfusion.Pdf.Parsing.PdfLoadedDocument.get_Form()
   at Syncfusion.Pdf.PdfDocumentBase.Append(PdfLoadedDocument ldDoc)
   at Syncfusion.Pdf.PdfDocumentBase.Merge(PdfDocumentBase dest, Object[] sourceDocuments)
   at DocumentConverters.PDFUtility.mergePDFDocuments(String[] pdfdocuments) in  

thanks
iosman

2 Replies

SL Sowmiya Loganathan Syncfusion Team October 21, 2019 01:51 PM UTC

Hi, 

Thank you for contacting Syncfusion support.  

We have checked with the issue which you have mentioned. In older version by default we have perform merge function by clone each and every objects from existing PDF document and dispose it. But effective from product version 17.1.0.32, we did not process the above. The existing PDF document will dispose only after saving of merged PDF document. So as per the provided stack trace we suspect that the issue will occurs due to this. So please set true to “EnableMemoryOptimization” of PDF document.  

Please refer the below KB link to know more about “EnableMemoryOptimization” property, 

Please try the above code snippet in your end and let us know if it solves the issue. If still you have faced the issue, please share us the PDF documents. It will helpful for us to provide the precise solution on this.  

Regards, 
Sowmiya L 




IM ios man replied to ios man November 5, 2019 01:54 AM UTC

Hello,

we were using 17.1400.0.38, when we do a merge to the multiple pdf document into a single documents, i am getting below error message. the same we were able to do it in 15.1.0.33. we are facing lot of mismatches between 15 and 17 versions. 
when we do merge we were getting below error message.

System.NullReferenceException: Object reference not set to an instance of an object.

   at Syncfusion.Pdf.IO.PdfStructTreeRoot.Add(PdfStructureElement structElement, PdfPageBase page, PdfDictionary annotDictionary)
   at Syncfusion.Pdf.Interactive.PdfFieldCollection.DoAdd(PdfField field)
   at Syncfusion.Pdf.Parsing.PdfLoadedFormFieldCollection.DoAdd(PdfField field)
   at Syncfusion.Pdf.Parsing.PdfLoadedFormFieldCollection.CreateFormFieldsFromWidgets(Int32 startFormFieldIndex)
   at Syncfusion.Pdf.Parsing.PdfLoadedDocument.get_Form()
   at Syncfusion.Pdf.PdfDocumentBase.Append(PdfLoadedDocument ldDoc)
   at Syncfusion.Pdf.PdfDocumentBase.Merge(PdfDocumentBase dest, Object[] sourceDocuments)
   at DocumentConverters.PDFUtility.mergePDFDocuments(String[] pdfdocuments) in  

thanks
iosman

thanks, my issue has been fixed ...






Loader.
Live Chat Icon For mobile
Up arrow icon