Main Board > Programming
Invoke PDF at Bookmark
guest188:
Is there a way to invoke a PDF file at a specific bookmark? Or, I guess opening it at a given page would be okay, but I'd prefer to use a bookmark.
Given a PDF called "test.pdf", which has multiple bookmarks, one of which is "Bookmark01". I currently open the PDF as follows:
SYSTEM_HELP "test.pdf"
Could I maybe do something like...
SYSTEM_HELP "test.pdf;@Bookmark01"
Devon Austen:
Here is some Adobe Acrobat Reader Documentation that may help.
https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf#page=5&zoom=auto,-169,394
I was able to accomplish what you were trying to do with the following
--- Code: ---invoke """C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe"" /A ""page=5"" ""test.pdf"""
--- End code ---
If the PDF is on the web it can be done with a #page=5 at the end of the URL or a #nameddest=destination.
Mike King:
Another option is to use *browser and pass it the page number or bookmark as in:
--- Code: ---def object h,@(0,0,80,24)="*browser"
h'navigate2("file://c:/temp/111/test.pdf#page=5")
--- End code ---
This works with Page numbers (#page=nnn) or Named destinations (#name).
guest188:
I am using SYSTEM_HELP so I would not have to specifically code for Adobe or a browser to display the file, I want Windows to use whatever is configured for rendering PDFs - that's what SYSTEM_HELP is doing just fine with SYSTEM_HELP "test.pdf"
So, none of the following work...
SYSTEM_HELP "test.pdf#Bookmark01"
SYSTEM_HELP "test.pdf#namedest=Bookmark01"
SYSTEM_HELP "test.pdf#page=3"
Oh, and my PxPlus 2017 does not have a *browser control.
Mike King:
The OS interface provided by Windows does not allow the passing of a page or bookmark as the interface within Windows looks at the prefix (i.e. http://) or the suffix (last dot onwards such as .exe, .pdf, ...). You have neither a recognizable prefix nor suffix thus the OS has no idea how to help open the file.
And trying "file://c:/name/of/directory/test.pdf#page=3" doesn't work -- it might if you had Chrome installed and set to respond the the file:// prefix but generally this is IE or EDGE.
Navigation
[0] Message Index
[#] Next page
Go to full version