My question is similar to "How can I programmaticly open a pdf at a certain point?", but the PDF is local, not on a web server.
I need a way to jump to a given page in a PDF that is on the users computer, that works across versions of Acrobat (or using an alternative PDF viewer like Foxit Reader). The PDF is going to be called from a Java app (it is only used on Windows, so cross-platform isn't a must), and right now it works with:
int pageNum = 24;
String manualPath = "C:\\Program Files\\Foo\\Bar\\Docs\\RefMan.pdf";
String acrordPath = "C:\\Program Files\\Adobe\\Reader 8.0\\Reader\\AcroRd32.exe";
String cmdString = "\"" + acrordPath + \" /A \"page=" + pageNum +
"=OpenActions\" \"" + manualPath + \"";
Process p = Runtime.getRuntime().exec(cmdString);
Obviously this will only work if the end user is using Acrobat 8 for 32bit, and installed it in the default location. I next tried using:
rundll32 url.dll,FileProtocolHandler file:///C:/Program%20Files/Foo/Bar/Docs/RefMan.pdf#page=24
thinking that this would open the users browser and jump to that page, but it simply opened Acrobat on page 1.
So I'm stumpped, and asking for help.