Link to home
Start Free TrialLog in
Avatar of Link-HRSystems
Link-HRSystems

asked on

open a pdf file to a specific page of the document

I need to open a PDF file at a specific page numbers, before version 8.1.1 of Adobe reader I used the parameters part of ShellExecute to set the page number, this no longer works.

I can open the document using:

filename := 'c:\manual.pdf';
ShellExecute(hInstance, nil, PChar(filename ), nil, nil, SW_SHOW);

Can anyone help with setting the page number?
Thanks
Avatar of Lukasz Zielinski
Lukasz Zielinski
Flag of Poland image

this is not using ShellExecute but works for me:


procedure TForm1.Button1Click(Sender: TObject);
var aread: TAcroPDF;
begin
  FReader := TAcroPDF.Create(nil);
  FReader.setShowToolbar(False);
  FReader.SetBounds(0, 0, Width - 30, Height - 30);
  FReader.ParentWindow := Self.Handle;
  FReader.LoadFile('C:\Documents and Settings\All Users\Documenten\RAD Studio\5.0\Demos\IntraWeb\Win32\Features\Downloads\multicast.pdf');
  FReader.setCurrentPage(7);
end;


TAcroPDF is defined in AcroPDFLib_TLB which can be generated from AcroPDF.dll

ziolko.
ASKER CERTIFIED SOLUTION
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If this is a Delphi related question, you should select the Delphi zone as the primary zone so the points
will go there.