0

I'm using c# and AxAcroPdf. I can load and view the Pdfs with no problem at all, but a bar keeps showing on the right hand side if I view the same Pdf more than once. I have placed the control on my form, I am not creating it programmatically.

My code is:

PreviewAcroPDF.LoadFile(FileName);
PreviewAcroPDF.setView("Fit");
PreviewAcroPDF.setShowToolbar(false);
PreviewAcroPDF.setLayoutMode("SinglePage");
PreviewAcroPDF.setPageMode("none");
PreviewAcroPDF.Show();

I am able to use ctrl H to manually change it but I do not want the end user to have to do this!

A screenshot of the bar I'm asking about:

Screenshot of bar

Thank you in advance!

Robert

Robert M
  • 1
  • 1
  • 2

2 Answers2

0

I was able to resolve this myself but could not find this post.

The solution was to go into adobe reader and change my preferences to not show the tool bar. It was nothing to be solved via programming, at lease that I could find.

Rich
  • 6,470
  • 15
  • 32
  • 53
Robert M
  • 1
  • 1
  • 2
0

I could not find which settings I had to change in Adobe itself but than I was thinking why not programmatically send the CTRL+H keys.

Dim thrd As Thread
AxAcroPDF1.src = $"{path}F9H-0000028.pdf"
thrd = New Thread(AddressOf ThreadTask) With {
    .IsBackground = True
}
thrd.Start()

and

Private Sub ThreadTask()
    Thread.Sleep(500)
    SendKeys.SendWait("^(h)")
    Thread.Sleep(10)
End Sub

The sleep 500 is a value that worked on my computer. A value of 100 was too low.

Miguel Terlaak
  • 175
  • 1
  • 13