tags:

views:

337

answers:

2

Hi,

I'm currently adding a PDF viewer in a Delphi program using TAcroPDF. My problem is, the touch screens that need to show the PDF are rather small, so I wanted to add bigger buttons for scrolling.

I thought I could use the function ScrollBy(DeltaX, DeltaY), but the function scrolls the component within it's container in stead of scrolling the document itself.

Is there some way to scroll the PDF document?

A: 

PDF browser controls are available through the AxAcroPDFLib.AxAcroPDF interface (TAcroPDF is just a pdf.ocx Wrapper), which provides, amongst others, the method SetViewScroll. This could be the way to go.

Unfortunately, the official documentation really sucks (for instance, the page for SetViewScroll actually describes SetViewRect... wtf?), you will have to do some testing...

Other methods that could be interesting for you are:

  • GotoFirstPage
  • GotoLastPage
  • GotoNextPage
  • GotoPreviousPage
  • SetCurrentPage
  • SetView
  • SetViewRect
Mef
+1  A: 

If you are up for rolling your own viewer, take a look at the QuickPDF Library. They have a RenderPageToStream function that will create a reliable image of your document in one of several different formats including BMP, JPG and TIFF among others. It's a decent solution and I have used it for printing fairly faithful versions of filled-in scanable government forms and have received no complaints from the government agencies where I have submitted them.