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.

Mon Mar 07, 2022 12:14 pm

Hello
We get a null reference exception on the AfterOpenAction property when executing the following code.

PdfDocument document = LoadFromFile();
.....
PdfPageBase page = document.Pages[PGoToPage];
PdfDestination destination = new PdfDestination(page);
destination.Zoom = PZoomFactor;
PdfGoToAction action = new PdfGoToAction(destination);
document.AfterOpenAction = action;

at Spire.Pdf.Actions.PdfDocumentActions..ctor(spr᝟ A_0)
at Spire.Pdf.PdfDocumentBase.get_JavaScripts()
at Spire.Pdf.PdfDocument.set_AfterOpenAction(PdfAction value)
at Ch.Infogate.Common.PDFWrapper.FillForm() in D:\InfogateApplications\branches\Tutoris_20211015_Version150\Infogate\InfogateCommon\Common\PDFWrapper\PDFWrapper.cs:line 240

[email protected]
 
Posts: 8
Joined: Thu Dec 17, 2015 2:15 pm

Tue Mar 08, 2022 2:53 am

Hello,

Thank you for your inquiry.
I tested your PDF file but didn't reproduce the issue you mentioned. The version I used is the latest Spire.PDF (Spire.PDF Pack(Hot Fix) Version:8.2.2). If you were not using the latest version, please first give it a try. If the issue still exists after trying, please provide the following information. You could attach them here or send them to us via email ([email protected]). Thanks in advance.

1) Your complete test project.
2) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF