Print Page | Close Window

open a pdf at a special page

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=610
Printed Date: 18 May 24 at 9:17PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: open a pdf at a special page
Posted By: Ingo
Subject: open a pdf at a special page
Date Posted: 19 Jan 07 at 3:28AM
Hi!

From time to time this question appears again ...
How to start a linked file ...
That's easy:
ShellExecute(hinstance,'open',PChar('c:\temp\test.pdf'), nil,  nil,SW_SHOWNORMAL);
You can use it in Delphi and (a bit modificated) in any other language.

I want to open the pdf-file at a special page. It should be temporarely (so i can't use SetOpenActionDestination).
I know that there are special parameters from adobe to do this?

How should i modify my ShellExecute to use this additional parameter?

Thanks a lot in advance!
Ingo




Replies:
Posted By: ukobsa
Date Posted: 19 Jan 07 at 9:14AM
Ingo,

this works for me on commandline:

"c:\Programme\Adobe\Acrobat 7.0\Reader\acrord32.exe" /a page=4 "d:\temp\RDF Primer.pdf"

Have also a look on this http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf - document

HTH,
Ulrich


Posted By: bogey
Date Posted: 19 Jan 07 at 11:26AM
Thanks Ingo,
 
I recently was asked this question both two different people. Now I have an answer other than "I am sure there must be a way, but I don't know how."
 
 


Posted By: Ingo
Date Posted: 19 Jan 07 at 2:31PM
Hi Uli!

Thanks a lot!
Like Ken said: I was one who told there is a parameter but i don't know how and where ;-)
...and now it's so easy ... but hard to find.

Best regards,
Ingo


Posted By: Ingo
Date Posted: 22 Jan 07 at 2:59PM
Hello!

I want to use ShellExecute having a universal call for the main readers ;-)
With Uli's help i've made this calls (Delphi):

In my test i wanted to open the document on page 4.

s := GetProgramAssociation('pdf');
s := PathGetLongName(s);

// example Foxit Reader
s := '"' + s + '"';
c := '"' + 'c:\temp\test.pdf' + '"' + ' -n 4';
ShellExecute(hinstance,'open',PChar(s), PChar(c), nil,SW_SHOWNORMAL);

// example Acrobat Reader
s := '"' + s + '"';
c := '/a page=4 ' + '"' + 'c:\temp\test.pdf' + '"';
ShellExecute(hinstance,'open',PChar(s), PChar(c), nil,SW_SHOWNORMAL);

You see each reader has its own parameter syntax for things like opening with pagenumbers. So if you want to open a pdf on a special page with all main readers you have to use "SetOpenActionDestination" with a copied version of the relevant pdf...

Best regards,
Ingo




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk