Re: Closing the PDF Document without selection showing Error

61 views
Skip to first unread message

Support

unread,
Apr 8, 2013, 1:46:56 PM4/8/13
to pdfne...@googlegroups.com
You need to first close the document in the view then dispose the document. Otherwise PDFView is referencing a disposed document which would cause the error.
 

On Thursday, April 4, 2013 8:10:17 AM UTC-7, vgs naidu wrote:
Hi,
i am using the PDFTron Control to show the pdfDocumet
We have a implemented the getting Coordinates of the Selected region using MyPDFView.cs and working fine. At the end, in Form_Closing Method we are trying to destroy the objects using the following Code.
 
_pdfdoc.Close();
_pdfview.CloseDoc();
_pdfview.Dispose();

It's working fine if I Click on the document and selecting some region.

But in another case, after opening the form if I trying to Close the form with out clicking on the document it showing Error in Form_Closing in the line

      _pdfview.CloseDoc();
And the Error is like below :

" AccessViolationException was Unhandled" and

"{"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."}"

What Could be the reason and how to handle it.

Thank you.

Reply all
Reply to author
Forward
0 new messages