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.
Unfortunately, activation email could not send to your email. Please try again.

Closing a PDF

Thread ID:

Created:

Updated:

Platform:

Replies:

88353 Jul 20,2009 01:15 PM Jul 21,2009 12:09 AM ASP.NET Web Forms (Classic) 2
loading
Tags: PDF
Jeff Dressing
Asked On July 20, 2009 01:15 PM

I am simply opening a PDF, then setting the page number on the page, then saving and closing it. After this, I cannot open the PDF again until the app gets closed. Why does .Close not close the PDF?

Here is a code snippet:

Private WithEvents mobjPDFDoc As PdfLoadedDocument
mobjPDFDoc = New PdfLoadedDocument(strFile)

'This is inside a loop...
dblHeight = mobjPDFDoc.Pages(intPage).Graphics.ClientSize.Height
dblWidth = mobjPDFDoc.Pages(intPage).Graphics.ClientSize.Width
mobjPDFDoc.Pages(intPage).Graphics.DrawString( _
"Page " & CStr(intPage + intTotalPageCount - 1), font, brush _
, New PointF(dblWidth - 220, dblHeight - 100))

... after done marking pages, save and close it.
mobjPDFDoc.Save()
mobjPDFDoc.Close()
mobjPDFDoc.Dispose()
mobjPDFDoc = Nothing

For some reason the PDF is still open after I close it. If I try to open it again in code or in Adobe Acrobat Reader, it tells me that it is currently opened by someone. How do I close it?

Thanks,
Jeff

Jeff Dressing
Replied On July 20, 2009 02:23 PM

I did not see the boolean completely parameter in the close command. After I sent it True, it worked fine.

Sri Subhashini M [Syncfusion]
Replied On July 21, 2009 12:09 AM

Hi Jeff,

Thank you for your interest in Essential PDF.

We were able to view the condition which you mentioned here. The overloaded Close(True) method helps you to close the existing document completely.

Please let me know if you need any information.

Regards,
Suba

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;