Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Jan 28, 2025 4:39 pm

Support,

All the sudden we start getting these error with our application. It's not allowing us to use the save method in our development and production.

using:

pdfDoc.SaveToFile( {path variable in our code} );

[NullReferenceException: Object reference not set to an instance of an object.]
spr克.僱(Int32 A_0) +32
spr侀.儓() +22
spr儺.僱(spr侀 A_0) +49
spr冱.僱(spr倻 A_0, spr儺 A_1, List`1 A_2, Dictionary`2 A_3, Boolean A_4) +85
spr冱.僱(spr倻 A_0, spr儺 A_1, List`1 A_2, Dictionary`2 A_3, Boolean A_4) +303
spr冱.僱(spr倻 A_0, spr儺 A_1, List`1 A_2, Dictionary`2 A_3, Boolean A_4) +303
spr冱.僱(spr倻 A_0, spr儺 A_1, List`1 A_2, Dictionary`2 A_3, Boolean A_4) +303
spr冱.僱(spr克 A_0, Boolean A_1) +132
spr冱.儂(spr克 A_0, spr凂 A_1) +48
spr冱.僱(PdfDocumentBase A_0) +496
spr⧙.Save(Stream stream) +198
Spire.Pdf.PdfDocumentBase.Save(String fileName) +80
Spire.Pdf.PdfDocument.SaveToFile(String filename) +23
forms_review.Page_Load(Object sender, EventArgs e) in c:\{page}.aspx.cs:1370
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
System.Web.UI.Control.OnLoad(EventArgs e) +97
System.Web.UI.Control.LoadRecursive() +61
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693

motogeek
 
Posts: 17
Joined: Tue Mar 16, 2021 4:18 am

Wed Jan 29, 2025 2:22 am

Hello,

Thank you for your message. Did this error occur when saving the specific document? Please provide your testing document. We will further investigate it. You can attach it here or send it to us via email ([email protected]). Thank you in advance.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1510
Joined: Wed Apr 25, 2018 3:20 am

Wed Jan 29, 2025 9:17 pm

We do not need any further assistance. The developer was appending a page to the current PdfDocument, closing the PdfDocumentobject before and then when saving the PdfDocumentobject to pdf file the PdfDocument object was no longer available hence the null response from the api.

Thanks

motogeek
 
Posts: 17
Joined: Tue Mar 16, 2021 4:18 am

Thu Jan 30, 2025 2:56 am

Hello,

Thank you so much for sharing the reason. If you have other questions, please do not hesitate to contact us. Wish you all the best!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1510
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.PDF

cron