Skip to main content
November 21, 2016
Question

PDF View in c# without toolbar nor any hindrances?

  • November 21, 2016
  • 2 replies
  • 8014 views

I have a windows form developed in Visual C# that displays the content of a PDF file with a reference to AxAcroPDFLib, but my boss doesn't want to see any toolbar nor side menus as shown in my image below here.  Here's what I have coded in my attempts to make this work but it doesn't seem to matter:

            axAcroPDF1.src = tmpTicketPdfPreviewPath;

            axAcroPDF1.setShowToolbar(false);

            axAcroPDF1.setView("FitH");

            axAcroPDF1.setLayoutMode("SinglePage");

            axAcroPDF1.setPageMode("none");

            axAcroPDF1.Show();

Please let me know if I'm missing anything here.  If not possible, I'm willing to look into other 3rd party vendors such as iTextSharp of SumatraPDF if possible.  Please advise, thanks.

4eUEE.png

    This topic has been closed for replies.

    2 replies

    Participant
    July 13, 2022

    try:

    axAcroPDF1.setView("read mode");

    Participant
    July 13, 2022

    Hi, Thanks for your tip ! I tried it, but unfortunately this does not change anything whatsoever. I think SetView() only controls the way the viewer fits into its container.

     

    Participant
    March 4, 2021

    YES!! Has Anyone found a solution to this?? I've been fighting this for months.

    Participant
    May 21, 2021

    I have this same issue, and can't find a way around it. Curiously, for the same pdf the result can be correct (just the pdf, see "ok.jpg") or incorrect (entire reader with the pdf in it surrounded by menus, toolbars, and whatnot, see "no ok.jpg"). There does not seem to be any logic to it. I tried any method or property I think could help, to no effect. 

    Any ideas appreciated !
    Thaks,
    Chris

    Participant
    July 22, 2021

    Same here. I have a form with TWO AcroPDF components. One of them alway shows it the way I want it. The other is ignoring my commands whatsoever. I have no clue why the same code works for one of them but not for the other component.

     

    AcroPDF1.setShowToolbar(False);
    AcroPDF1.setShowScrollBars(False);
    AcroPDF1.setPageMode('none');

     

    BUT maybe this helps someone: I found out that the shortcut for the effect I want to achieve is CTRL+H. This puts the reader in "Read" mode, which hides every other tool or bar. For now, I don't know how to check if the file already is in readmode, but maybe some of you guys has an idea for this?

     

    Greetings,

     

    JP