PDF View in c# without toolbar nor any hindrances?

Community Beginner ,
Nov 21, 2016 Nov 21, 2016

Copy link to clipboard

Copied

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

Views

2.3K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 04, 2021 Mar 04, 2021

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 21, 2021 May 21, 2021

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 22, 2021 Jul 22, 2021

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 24, 2021 Jul 24, 2021

Copy link to clipboard

Copied

This is interesting, thanks ! I thought I'd be able to do this programmatically as follows 

axAcroPDF1.src=fil;
axAcroPDF1.Focus();
SendKeys.Send("^h");

but unfortunately this has no effect whatsoever. It probably would not solve the problem if it worked, because it's a toggle and the problem is inconsistent, i.e. it sometimes occurs and sometimes not.
I notice your component is AcroPDF1 whereas mine is axAcroPDF1. Did you rename it, or are we using different things ? Does the above code do something for you ?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2022 Jul 13, 2022

Copy link to clipboard

Copied

try:

axAcroPDF1.setView("read mode");

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2022 Jul 13, 2022

Copy link to clipboard

Copied

LATEST

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.

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines