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.
Copy link to clipboard
Copied
YES!! Has Anyone found a solution to this?? I've been fighting this for months.
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
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
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 ?
Copy link to clipboard
Copied
if(axAcroPDF1.LoadFile(filePath)){
axAcroPDF1.Focus();
SendKeys.Send("^h");
}
Copy link to clipboard
Copied
if(axAcroPDF1.LoadFile(filePath))
{
System.Threading.Thread.Sleep(1000);
axAcroPDF1.setShowToolbar(false);
axAcroPDF1.setShowScrollbars(false);
axAcroPDF1.Focus();
SendKeys.Send("^h");
}
Copy link to clipboard
Copied
Hello Jaime,
Thanks for your reply, much appreciated.
I tried your code verbatim, but unfortunately it doesn't change anything for me. The focus and sendkey calls I had already tried to no avail.
Cheers,
Chris
Copy link to clipboard
Copied
try:
axAcroPDF1.setView("read mode");
Copy link to clipboard
Copied
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.