|
-
Sep 19th, 2006, 02:12 PM
#1
Thread Starter
Frenzied Member
printing PDF files
I'm referencing "Adobe Acrobat 7.0 Browser Control Type Libary 1.0" and I have the following code:
Code:
private void button1_Click(object sender, System.EventArgs e)
{
AcroPDFLib.AcroPDFClass pdf;
pdf = new AcroPDFLib.AcroPDFClass();
pdf.src = @"C:\sample.pdf";
pdf.Print();//i tried pdf.PrintAll() and pdf.PrintPages() - both didn't work
}
Any idea why this isn't working? I'm using Acrobat 7.0 by the way. Also, when I use pdf.LoadFiles() instead of pdf.src, i get an error message saying "object not initialized", and this was with the "new AcroPDFLib.AcroPDFClass()" line included.
-
Sep 19th, 2006, 06:32 PM
#2
Re: printing PDF files
It works using the ActiveX control so maybe the AcroPDFClass class isn't meant to be used on its own. Strange that it's available if it's not but I can't really see a way to check that the specified file was actually loaded. I tried LoadFile in a VB app and it threw an exception regarding trying to write protected memory. Not good at all.
-
Nov 12th, 2007, 08:34 AM
#3
New Member
Re: printing PDF files
THE PROBLEM IS...
that we aren't supposed to use the COM like that (as the previous poster has mentioned).
After 5 hours of nutting this out, I finally understood what some posters meant (in other forums).
In simple terms:
- DO NOT use the 'Add reference' menu to add the .dll file
- Instead, right click on the toolbar where you design your forms, and choose to add more tools (customize or something like add more)
- Choose the Adobe Reader ActiveX tool
now in your references window you should see the elusive AxAdobePDF component.
What I do is to just place a PDF viewer onto my form, and make it invisible.
Cheers,
Wilson
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
|