Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing problems with pdf.ocx and Reader 6 1

Status
Not open for further replies.

Ron143

Programmer
Jun 18, 2002
5
US
I have an application written in vb 6 which uses the pdf.ocx control to view and print pdf files. Reader versions prior to 6 worked fine.

When I upgraded to Reader 6 it stopped working. At first I could print a pdf file once (using the pdf1.printall command), if I used the pdf1.printall command again nothing would happen. If I use the pdf1.printwithdialog command it will print every time. Has anyone seen this issue? Does anyone have any suggestions?

Here is the code from a test project I created to test it. The form only has the pdf control (pdf.ocx - version, 6.0.0.878) and two command buttons.

Private Sub cmdPrint_Click()
Pdf1.printAll
End Sub
Private Sub cmdPrintDialog_Click()
Pdf1.printWithDialog
End Sub
Private Sub Form_Load()
Pdf1.src = "C:\Program Files\Adobe\Acrobat 6.0\Resource\ENUtxt.pdf"
End Sub

Thank you for any help
Ron

 
I am getting the exact same problem... Only with mine, If I put a break point just before the print step, and then step into the .Print line, it brings up the dialog box (confirmation) to prnit. I dont know how to get rid of this.

MH
 
Ron143..

I dont know if this is helpfull, but I finaly got it to work..

Here is what I did..

1) Uninstall all versions of Adobe Reader.
2) Install reader version 5.x
3) Install reader version 6.0 (if desired)
4) Remove your pdf.ocx referece from your application
5) Save, restart VB
6) Re-Referece the pdf.ocx, BUT point to the ocx from adobe version 5.x NOT 6.0.

I spent most of the day working on this, and finaly got it working that way. I also noticed that the .Printall did not work. Just using .Print by itself worked for me. I used .LoadFile(filename) to load the file. My code looks something like this:

With objPDF
.LoadFile("c:\temp\doc.pdf")
.Print
End With

I hope this helps... As I am sure you are aware, information about the pdf.ocx object is NOWHERE to be found on the internet.

Reguards..
 
I thought about using an old version of the pdf.ocx but I have not had a chance to work on it this week. I have one concern about using an old version of the pdf.ocx. I need to create an installation using install shield. In the past I was unable to include the pdf.ocx in the installation because when reader is installed it would interfere with the version of the pdf.ocx I included in my installation because there were two copies of the ocx. Have you created an installation and tested it that way? In the past I have found out that running the program in development mode behaves differently than running an installed version.

In my case I install the vb program and then install Adobe reader, allowing reader to install the pdf.ocx.

Thanks for the info.
Ron
 
NO, fortently for my situation, The server that my application runs on is in the room next to me. I did not need to create an install package for it. I just made sure to keep the pdf.ocx file in the same directory as the exe.

I did however keep all files / dll's (that my vb app uses) in addition to the adobe 5.0 install file - all in the same folder, in case the program id need to be reinstalled.


Mark
 
Hi Guys
I was trying to use the pdf.ocx to print and it not working. I did a search on the web and found the similar stuff.
I tried printall and printWithDialog but nothing happens :(
pdf.OCX version on my pc is 5.1.0.193
I have checked and c:\1.pdf exists, and I can open using acrobat.
I dunno why it is not working. I was using following commands. I would appreciate you help.
Cheers
Raj

Private Sub Command1_Click()
Dim xx As New Pdf
xx.LoadFile ("c:\1.pdf")
xx.printall
End Sub

Private Sub Command1_Click()
Dim xx As New Pdf
xx.LoadFile ("c:\1.pdf")
xx.printWithDialog
End Sub
 
I got it to work, but i had to down grade to Adobe 5.x If you use version 6, it WILL NOT WORK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top