open a pdf file from access and go to a specific page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a large 460+ page pdf file. I want to be able to open the pdf file
and go to a specific page, say page 99. There will be a control on my form
that has the page number. The pdf file will always be the same one with a
specific path. Any help or thoughts on this would be greatly appreciated.
Thanks.
 
Dean,

To quote a post from Saturday:

According to Adobe’s web site, neither Reader nor Acrobat support command
line parameters:

“Other Acrobat applications, including Acrobat, Catalog, PDFWriter, and
Reader, are not designed to be run from a command line. Therefore, Adobe does
not support running Acrobat applications other than Distiller from a command
line.â€

(See http://www.adobe.com/support/techdocs/321090.html )

You can open and display the pdf using SHELL [PathToAdobeReader]
(space)[PathToDocument], but I don't know of a way to go to a specific page.

If the user doesn't need to see the whole document, you can use PDF995 and
PDFEdit995 to print just the page range you need to a new pdf, then open that
one.
(You use VBA to set parameters in PDFEdit.ini to tell it where to create the
file and what pages to include.) See www.pdf995.com

Bruce
 
Bruce,

Thank you for your response.

I saw that one that you have mentioned and went to PDF995 and downloaded the
program, but haven't had a chance to look at it too closely, so I wasn't sure
if it had a way to go to a specific page. I've seen several PDF hacking
programs that will extract a single page which may be the way I have to go.

If I figure anything else out, I'll make a post here because I'd sure like
to find a way to do that. We've spent a bunch of money developing a new
catalog (the one with 460+ pages) and made it into an interactive PDF file
with quite a few links from text on one page to another page. But if I just
extract one page (for users of our Access order entry program), I doubt if
those links will still work and that will diminish the functionality. But
I'll try.

BruceS said:
Dean,

To quote a post from Saturday:

According to Adobe’s web site, neither Reader nor Acrobat support command
line parameters:

“Other Acrobat applications, including Acrobat, Catalog, PDFWriter, and
Reader, are not designed to be run from a command line. Therefore, Adobe does
not support running Acrobat applications other than Distiller from a command
line.â€

(See http://www.adobe.com/support/techdocs/321090.html )

You can open and display the pdf using SHELL [PathToAdobeReader]
(space)[PathToDocument], but I don't know of a way to go to a specific page.

If the user doesn't need to see the whole document, you can use PDF995 and
PDFEdit995 to print just the page range you need to a new pdf, then open that
one.
(You use VBA to set parameters in PDFEdit.ini to tell it where to create the
file and what pages to include.) See www.pdf995.com

Bruce


Dean B said:
I have a large 460+ page pdf file. I want to be able to open the pdf file
and go to a specific page, say page 99. There will be a control on my form
that has the page number. The pdf file will always be the same one with a
specific path. Any help or thoughts on this would be greatly appreciated.
Thanks.
 
Dean,

You'll also need PDFEdit995. One you have paid the license fee ($20 or so
for both) you can email tech support. Maybe they can tell you how to index
down to a specific page. They also have some other utilities (a "suite")
that may offer some options.

Good luck with it!

Bruce

Dean B said:
Bruce,

Thank you for your response.

I saw that one that you have mentioned and went to PDF995 and downloaded the
program, but haven't had a chance to look at it too closely, so I wasn't sure
if it had a way to go to a specific page. I've seen several PDF hacking
programs that will extract a single page which may be the way I have to go.

If I figure anything else out, I'll make a post here because I'd sure like
to find a way to do that. We've spent a bunch of money developing a new
catalog (the one with 460+ pages) and made it into an interactive PDF file
with quite a few links from text on one page to another page. But if I just
extract one page (for users of our Access order entry program), I doubt if
those links will still work and that will diminish the functionality. But
I'll try.

BruceS said:
Dean,

To quote a post from Saturday:

According to Adobe’s web site, neither Reader nor Acrobat support command
line parameters:

“Other Acrobat applications, including Acrobat, Catalog, PDFWriter, and
Reader, are not designed to be run from a command line. Therefore, Adobe does
not support running Acrobat applications other than Distiller from a command
line.â€

(See http://www.adobe.com/support/techdocs/321090.html )

You can open and display the pdf using SHELL [PathToAdobeReader]
(space)[PathToDocument], but I don't know of a way to go to a specific page.

If the user doesn't need to see the whole document, you can use PDF995 and
PDFEdit995 to print just the page range you need to a new pdf, then open that
one.
(You use VBA to set parameters in PDFEdit.ini to tell it where to create the
file and what pages to include.) See www.pdf995.com

Bruce


Dean B said:
I have a large 460+ page pdf file. I want to be able to open the pdf file
and go to a specific page, say page 99. There will be a control on my form
that has the page number. The pdf file will always be the same one with a
specific path. Any help or thoughts on this would be greatly appreciated.
Thanks.
 
I'm getting a little closer to being able to open a pdf file and go to a
specific page, but am having trouble with the VBA code to open an OLE object
using Adobe's OLE Automation Interface (read IACReference.pdf at the link
below)

http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/iac/IACReference.pdf

I think that I have to define a variable and then set it to reference the
Adobe so I can use the Adobe methods such as "LoadFile" and "SetCurrentPage"
so I can open the file that I want and then go to a specific page within the
file.

I'm just not able to come up with the correct syntax to reference the Adobe
library and use its methods. Any suggestions would be greatly appreciated.

Thanks.
 
I'm still working on getting a PDF file to open from Access using VBA and
then going to a specific page. I'm trying to use OLE Automation to
accomplish this. In the VBA editor, I went to Tools|References and checked
"Adobe Acrobat 7.0 Browser Control Type Library" which uses AcroPDF.dll.
After that, when opening up the object browser, I can select the AcroPDFLib
which has the class AcroPDF.

Then I should be able to use the following code:

Dim App2 As New AcroPDFLib.AcroPDF

With App2

.src = "C:\corsiquote\symphony2007i.pdf"
.LoadFile ("C:\corsiquote\symphony2007i.pdf")
.setCurrentPage (10)

End With

The NEW statement works because I get VBA editing help with the methods from
the AcroPDFLib, but the code still doesn't open the file and doesn't go to a
specific page (page 10 in this example)

I've tried opening up Acrobat Reader first, then using the code, I've tried
having the document open in Reader before using the code, but none of that
works.

Any more help on using OLE Automation within Access VBA would be appreciated.

Thanks.

BruceS said:
Dean,

You'll also need PDFEdit995. One you have paid the license fee ($20 or so
for both) you can email tech support. Maybe they can tell you how to index
down to a specific page. They also have some other utilities (a "suite")
that may offer some options.

Good luck with it!

Bruce

Dean B said:
Bruce,

Thank you for your response.

I saw that one that you have mentioned and went to PDF995 and downloaded the
program, but haven't had a chance to look at it too closely, so I wasn't sure
if it had a way to go to a specific page. I've seen several PDF hacking
programs that will extract a single page which may be the way I have to go.

If I figure anything else out, I'll make a post here because I'd sure like
to find a way to do that. We've spent a bunch of money developing a new
catalog (the one with 460+ pages) and made it into an interactive PDF file
with quite a few links from text on one page to another page. But if I just
extract one page (for users of our Access order entry program), I doubt if
those links will still work and that will diminish the functionality. But
I'll try.

BruceS said:
Dean,

To quote a post from Saturday:

According to Adobe’s web site, neither Reader nor Acrobat support command
line parameters:

“Other Acrobat applications, including Acrobat, Catalog, PDFWriter, and
Reader, are not designed to be run from a command line. Therefore, Adobe does
not support running Acrobat applications other than Distiller from a command
line.â€

(See http://www.adobe.com/support/techdocs/321090.html )

You can open and display the pdf using SHELL [PathToAdobeReader]
(space)[PathToDocument], but I don't know of a way to go to a specific page.

If the user doesn't need to see the whole document, you can use PDF995 and
PDFEdit995 to print just the page range you need to a new pdf, then open that
one.
(You use VBA to set parameters in PDFEdit.ini to tell it where to create the
file and what pages to include.) See www.pdf995.com

Bruce


:

I have a large 460+ page pdf file. I want to be able to open the pdf file
and go to a specific page, say page 99. There will be a control on my form
that has the page number. The pdf file will always be the same one with a
specific path. Any help or thoughts on this would be greatly appreciated.
Thanks.
 
Dean,

Sorry, but I don't have enough experience in OLE Automation to be of much
help. Suggest a new post with a subject like "OLE Automation help needed".
It should attract one of the MVPs that may be able to help you.

(Reason to do a new post: Most people don't look at posts that are more
than a couple of days old unless they find it with a search for a specific
topic.)

Good luck with it! If you find a solution, shoot me an email to bruce at
springthorpe dot org. I'd love to see it.

Bruce


Dean B said:
I'm still working on getting a PDF file to open from Access using VBA and
then going to a specific page. I'm trying to use OLE Automation to
accomplish this. In the VBA editor, I went to Tools|References and checked
"Adobe Acrobat 7.0 Browser Control Type Library" which uses AcroPDF.dll.
After that, when opening up the object browser, I can select the AcroPDFLib
which has the class AcroPDF.

Then I should be able to use the following code:

Dim App2 As New AcroPDFLib.AcroPDF

With App2

.src = "C:\corsiquote\symphony2007i.pdf"
.LoadFile ("C:\corsiquote\symphony2007i.pdf")
.setCurrentPage (10)

End With

The NEW statement works because I get VBA editing help with the methods from
the AcroPDFLib, but the code still doesn't open the file and doesn't go to a
specific page (page 10 in this example)

I've tried opening up Acrobat Reader first, then using the code, I've tried
having the document open in Reader before using the code, but none of that
works.

Any more help on using OLE Automation within Access VBA would be appreciated.

Thanks.

BruceS said:
Dean,

You'll also need PDFEdit995. One you have paid the license fee ($20 or so
for both) you can email tech support. Maybe they can tell you how to index
down to a specific page. They also have some other utilities (a "suite")
that may offer some options.

Good luck with it!

Bruce

Dean B said:
Bruce,

Thank you for your response.

I saw that one that you have mentioned and went to PDF995 and downloaded the
program, but haven't had a chance to look at it too closely, so I wasn't sure
if it had a way to go to a specific page. I've seen several PDF hacking
programs that will extract a single page which may be the way I have to go.

If I figure anything else out, I'll make a post here because I'd sure like
to find a way to do that. We've spent a bunch of money developing a new
catalog (the one with 460+ pages) and made it into an interactive PDF file
with quite a few links from text on one page to another page. But if I just
extract one page (for users of our Access order entry program), I doubt if
those links will still work and that will diminish the functionality. But
I'll try.

:

Dean,

To quote a post from Saturday:

According to Adobe’s web site, neither Reader nor Acrobat support command
line parameters:

“Other Acrobat applications, including Acrobat, Catalog, PDFWriter, and
Reader, are not designed to be run from a command line. Therefore, Adobe does
not support running Acrobat applications other than Distiller from a command
line.â€

(See http://www.adobe.com/support/techdocs/321090.html )

You can open and display the pdf using SHELL [PathToAdobeReader]
(space)[PathToDocument], but I don't know of a way to go to a specific page.

If the user doesn't need to see the whole document, you can use PDF995 and
PDFEdit995 to print just the page range you need to a new pdf, then open that
one.
(You use VBA to set parameters in PDFEdit.ini to tell it where to create the
file and what pages to include.) See www.pdf995.com

Bruce


:

I have a large 460+ page pdf file. I want to be able to open the pdf file
and go to a specific page, say page 99. There will be a control on my form
that has the page number. The pdf file will always be the same one with a
specific path. Any help or thoughts on this would be greatly appreciated.
Thanks.
 
I have been using this line in vb to open a pdf

Application.FollowHyperlink "C:\MyFolder!\Manual.
pdf#pagemode=bookmarks&page=2"

Have just recently added the "#pagemode=bookmarks&page=2" which should, in
theory, open to page 2 as this would appear to be just another url link to
Windows? yes?

It doesn't work for me, (opens but not to the page) but I am using 6.0 and am
loathe to upgrade unecessarily. Could you try it and let me know if if works
for you in 7.0?
 
Doesn't work for me, using either Access 97 or Access 2003 with Acrobat
Reader 7.0.8
 
Thanks Doug, it's a damn shame because it sure would be nice.

If you paste that string directly in IE if works like a charm though!!

file:///C:/MyFolder!/Manual.pdf#page=5

which lead me to believe that this can be done with Dev's code at
http://www.mvps.org/access/api/api0051.htm

I will see if I can get something going with it.
 
Well not much luck with Dev's code, my small brain couldn't get it to work.

However I did discover

Application.FollowHyperlink "c:/MyEstimator!/Manual.pdf#page=5"

Opens in the Acrobat viewer on page 1, one Security warning, (which I cannot
rid myself of despite making the appropriate changes using regedit.)

Application.FollowHyperlink "file:///C:/MyEstimator!/Manual.pdf#page=5"
Opens in IE on page 5... yay, but 3 warnings in all, standard Office warning
(which I cannot get rid of) then the Activex warning in IE broswer window
plus an additional message box security warning about the Activex after
allowing the first one...

Not terribly elegant but closer to the target
 
Back
Top