How to close pdf file?

7 posts, 1 answers
  1. Thomas
    Thomas avatar
    22 posts
    Member since:
    Oct 2012

    Posted 25 Feb 2013 Link to this post

    Hi,

    I'm using PdfViewer and it works file, but how to unload opened document programmatically?
  2. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 28 Feb 2013 Link to this post

    Hi Thomas,

    Thank you for writing.

    Currently, RadPdfViewer does not have a feature for unloading documents. I will add this as a feature request in our
    Public Issue Tracking System. Feel free to add your vote for it here: http://www.telerik.com/support/pits.aspx#/public/winforms/14400.

    Your Telerik Points have been updated for this report.

    For the time being, you can add a new menu item in the context menu for example ("Close") and when it is clicked, you can load an empty pdf file like the one attached.
        RadMenuItem close = new RadMenuItem("Close");
        close.Click += close_Click;
        radPdfViewer1.RadContextMenu.Items.Add(close);
     //....
    void close_Click(object sender, EventArgs e)
    {
        radPdfViewer1.LoadDocument(@"C:\BLANK.pdf");
    }

    I hope that you find this information useful

    Regards,
    Stefan
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Join us for a FREE webinar to see all the new stuff in action.

    Interested, but can’t attend? Register anyway and we’ll send you the recording.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. RAG
    RAG avatar
    16 posts
    Member since:
    Oct 2011

    Posted 01 Mar 2013 Link to this post

    Hi,

    you can also set the visible-Property of the Viewer-Control to false until you load a new document - that's the way I do it.
  5. Marco
    Marco avatar
    87 posts
    Member since:
    Apr 2011

    Posted 05 Jul 2013 Link to this post

    Just for a quick update.

    This feature has been added to the RadPdfViewer.

    You could now use the UnloadDocument() Sub of a RadPdfViewer.

    If someone in Telerik staff could add a line in the online documentation about that. Will save some time to all developper which where traumatize by Adobe's PDF viewer control.

     

     

     

     

     

  6. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 08 Jul 2013 Link to this post

    Thank you for your suggestion Marco. I will make sure this gets into the documentation with the next upload.
     
    Regards,
    Stefan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  7. John Littleton
    John Littleton avatar
    1 posts
    Member since:
    Mar 2009

    Posted 09 Jan 2014 Link to this post

    Hello. I am using the RadPDFViewer control, and have found that when the UnloadDocument method is called it does clear the document from view, but does not actually release the file until another document is loaded. Is there a way to force it to release a file without having to load another file? Thanks.
  8. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 10 Jan 2014 Link to this post

    Hello John,

    Thank you for writing. 

    I have tested the UnloadDocument and it seems that on my end the pdf file is released appropriately. Can you please provide me with details about the scenario you are testing, so I can reproduce the same case on my end and help you with it?

    I am looking forward to your reply. 

    Regards,
    Stefan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready