|
-
Jan 25th, 2006, 02:24 PM
#1
Thread Starter
Hyperactive Member
Print 1st page of PDF
How do I Print the 1st page of a PDF? I currently use:
VB Code:
ShellExecute(hDesktop, "Print", "somefilename.pdf", vbNullString, "C:\",0)
but it prints it all when I just want the first page.
thanks
---edit---
the program used Crystal Report Application server, so i just used the export feature to word and used the word application object to print page 1, but thanks for all of the interest.
Last edited by johnweidauer; Jan 27th, 2006 at 02:55 AM.
Reason: not enough description
To the world you may just be one person, but to this one person, you just might be the world.
-
Jan 25th, 2006, 07:14 PM
#2
Re: Print 1st page of PDF
If you have the Acrobat Reader then you could use the Acrobat Control for ActiveX. Put it on a Form and then call the LoadFile method followed by the PrintPages method.
-
Jan 26th, 2006, 12:53 AM
#3
Re: Print 1st page of PDF
From some Google searches I've found that, Adobe doesn't support/approve using Acrobat Reader OCX in our projects. 
It is there only to display pdf in IE.
Make sure it is leagal, if it is a commercial project or you want to distribute your project (even for free).
-
Jan 26th, 2006, 12:57 AM
#4
Re: Print 1st page of PDF
Try PDFCreator. It is programmable for saving files. It might be good at printing files as well.
-
Jan 26th, 2006, 05:41 AM
#5
Re: Print 1st page of PDF
 Originally Posted by iPrank
From some Google searches I've found that, Adobe doesn't support/approve using Acrobat Reader OCX in our projects. 
It is there only to display pdf in IE.
That was the most stupid thing I ever heard. In that case it would be legal to display it using the webbrowser control.
-
Jan 26th, 2006, 02:39 PM
#6
Re: Print 1st page of PDF
Yep. That would be legal, but we'll need extra work.
Anyway, I found some needed info in PowerBasic forum. But for some reason the original poster has deleted all his threads on January 7th. Here is the Google cache:
http://72.14.203.104/search?q=cache:...n&ct=clnk&cd=1
In that page he said,
 Originally Posted by Chuck Hicks of PowerBasic Forum
-
Jan 26th, 2006, 04:52 PM
#7
Re: Print 1st page of PDF
Something like this should work:
VB Code:
Private Sub Command1_Click()
AcroPDF1.LoadFile "C:\MyPDFFile.pdf" 'Load a file
AcroPDF1.printPages 1, 1 'Print first page
End Sub
-
Jan 26th, 2006, 08:20 PM
#8
Re: Print 1st page of PDF
 Originally Posted by iPrank
Something like this should work:
VB Code:
Private Sub Command1_Click()
AcroPDF1.LoadFile "C:\MyPDFFile.pdf" 'Load a file
AcroPDF1.printPages 1, 1 'Print first page
End Sub
Which is exactly what I suggested in my origional post
-
Jan 27th, 2006, 12:31 PM
#9
Re: Print 1st page of PDF
Yes. That was your idea. 
Anyway, johnweidauer has sloved his problem in other way. But I have found the new lincensing info when searching for him. Thanks to both of you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|