NullReferenceException in PdfViewerControl when setting Window SizeToContent to Width/Height
I am encountering a NullReferenceException when setting the SizeToContentproperty on the window that hosts the PdfViewerControlto either
Width or Height
The exception message is as follows:
System.NullReferenceException: 'Object reference not set to an instance of an object.'After the exception, visual Studio automatically decompiled the source code and pointed to the following line where the exception occurs:
// DocumentToolbar.cs
elseif(m_activeView.CursorMode==PdfViewerCursorMode.HandTool&& m_buttonPan !=null)//m_activeView is null
{
m_selectToolToggleButton.IsChecked=false;
m_buttonPan.IsChecked=true;
m_buttonPan.IsHitTestVisible=false;
}
SyncfusionPdfViewer.WPF version: 27.1.50
Attachment: SampleAppCore_7d82b012.zip
We were able to reproduce the reported issue with the provided details on our end, and currently we are analyzing it. We will provide further details on December 27th, 2024
We have confirmed the issue "`NullReferenceException` occurs when SizeToContentproperty of window is set to either Width or Height" as a defect in our product and we will include the fix into our upcoming weekly NuGet release which will we available on 7th January 2025.
Please use the below feedback link to track the status of the reported bug.
Note: If you require a patch for the reported issue in any of our Essential Studio Main or SP release version, then kindly let us know the version, so that we can provide a patch in that version based on our SLA policy.
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”