This issue affects both my VB.NET and C# Winform applications. When closing Form containing Adobe PDF Viewer conreol, the Form takex some 10 seconds to close. I tracked the issue down to Dispose method. Normally, in C# all it takes it so steal focus from Adobe PDF Control by adding lines to FormClosing event handler but in VB.NET, even if I steal focus, it still takes way too long for the Form to close. I tried to explicitly dispose the control and Implicitly - by disposing the containing Form. I tried empty string in LoadFile() method. I tried new reference to new interop library. Nothing works.
Also, if you would suggest a different API/library to replace AxAcroPDFlib I'd love to read what you use.
Acrobat PDF viewer control takes time to dispose
1k Views Asked by ArtK At
1
There are 1 best solutions below
Related Questions in VB.NET
- If...Then...Else Visual Basic 2012
- Detecting whether a mouse button is down in vb.net
- IOrderedEnumerable to vb.net IOrderedEnumerable Conversion
- vb.net Get PrivateMemorySize64 and process id sort by memory size
- Cannot insert values into database
- check validation of an expression with Regex
- VB.NET KeyNotFoundException from String()
- How do i display data that are in between 2 values in a DDL?
- VB.net: How to make original variable value fulfill 2 statements?
- Login form by using a new database, made in VB
- Get Text from listbox in VB.net
- error handing for uploading large size file
- XML Null Element Visual Basic
- Using chart and tooltip
- vb2010 Express - Operator '=' is not defined
Related Questions in WINFORMS
- What is this namespace ITypeOfObjectsBoundToListBox ? Couldn't find it
- How to Require Confirmation on Form Close When there is Changed Data in a DataGridView
- self updating drawings C#
- Missingmanifestresourseexeption in auto genereted code of ImageList
- Child form implement in C# Winform
- Cannot find InvalidCastException in C# Application
- some labels appear gray in Visual Studio 2010
- c# richtextbox search with 2 forms
- Menu out of place when application is in full screen by Windows API
- How to access the Index of a changed Selection in a Datagridview
- showing a black transparent box over picturebox with an Image
- how to deselect all in RichTextBox before selecting newly found text?
- How to remove white space between border and BackColor?
- Validation DataGridView Windows Forms
- Invoke of a UserControl doesn't work
Related Questions in AXACROPDF
- Embedding AxAcroPDF into my form causes it to load in the background randomly
- How to directly access text in AxAcroPDFLib?
- How to detect if AxAcroPdf component has loaded PDF?
- WPF / C# Display of Acrobat Toolbar
- Prevent user from printing/saving PDF file in C#
- How to search text (Exect match) in pdf in C#
- How can I get number of pages in a pdf file in AxAcroPdf?
- AxAcroPdf Control - Issues reloading PDF
- Finding coordinates of subform within form, in specific area
- AxAcroPDFLib.AxAcroPDF in Word Addin (32bit & 64bit)
- Embed a PDF into a WPF application
- File being used by another process when using File.CopyTo method
- Adobe PDF Reader component (AcroPDF.dll) - is it possible to access table of contents and bookmarks from code?
- AcroPDFlib, AxAcroPDFLib commercial use
- how to get the selected text from acropdf component to an edit directly with Delphi 7
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I now have a solution. Early testing is promising. In short, add
Controls.Remove(yourPdfViewerControl)toFormClosingevent handler. Of course this will offer instant alleviation of the problem but may cause memory leak. After you have removed the control fromContaineryou could assugnnullto its memory address and hope that memory manager will do its job.So in order to prevent the leak, I created a class holding one memory space for
PdfViewercontrol. If aFormneeds a viewer, it requests it from an object that is accessible from any form to prevent memory leaks. To avoidDisposemethod invocation whenFormcloses, make sure you remove thisControlfromControlscontainer. I can provide sample code if needed.