Article View: adobe.acrobat.sdk
Article #34Re: Using VB6 to print a PDF with Acrobat 9
From: McKilty
Date: Thu, 17 Sep 2009 17:29
Date: Thu, 17 Sep 2009 17:29
43 lines
2858 bytes
2858 bytes
On Sep 16, 3:51 pm, McKilty <bluesbr...@gmail.com> wrote:
> I have an app that allows users to select multiple files and print
> them regardless if they are Word, Excel, PowerPoint, or PDF files. I
> had it working on my computer, but I had Acrobat 7. The rest of the
> staff has Acrobat 9 and when the print, nothing happens.
>
> So I installed Acrobat 9 and now nothing happens for me either. In
> VB6, the reference I use is Adobe Acrobat 9.0 Type Library. The code
> is as follows:
>
> Public Sub AcrobatPrint(Filename As String)
>
> Dim AcroExchApp As Acrobat.CAcroApp
> Dim AcroExchAVDoc As Acrobat.CAcroAVDoc
> Dim AcroExchPDDoc As Acrobat.CAcroPDDoc
> Dim num As Integer
>
> Set AcroExchApp = CreateObject("AcroExch.App")
> Set AcroExchAVDoc = CreateObject("AcroExch.AVDoc")
>
> ' Open the [strfiley] pdf file
> AcroExchAVDoc.Open Filename, ""
>
> ' Get the PDDoc associated with the open AVDoc
> Set AcroExchPDDoc = AcroExchAVDoc.GetPDDoc
>
> ' Get the number of pages for this pdf [and subtract one as zero
> based]
> num = AcroExchPDDoc.GetNumPages - 1
> Call AcroExchAVDoc.PrintPages(0, num, 1, True, True)
>
> 'AcroExchApp.Show 'activate this line if you want to see the acrobat
> file
> AcroExchApp.Exit
> AcroExchAVDoc.Close (True)
> AcroExchPDDoc.Close
>
> End Sub
>
> It opens the file and gets the page count, but the print command is
> pretty much ignored. Any ideas?
Hmmm.... Nothing, huh? I'll try in a VB forum I suppose.
Technical Details
Message-ID:
<1415ada5-b8fe-444b-8b92-7bc7f52270ff@s21g2000prm.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!s21g2000prm.googlegroups.com!not-for-mailReferences:
<2157b29e-a603-4f0d-8028-38c675e51644@o36g2000vbl.googlegroups.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 2105b4c04d,dba07793549f6cb0 X-Google-Attributes: gid2105b4c04d,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!s21g2000prm.googlegroups.com!not-for-mail From: McKilty <bluesbrthr@gmail.com> Newsgroups: adobe.acrobat.sdk Subject: Re: Using VB6 to print a PDF with Acrobat 9 Date: Thu, 17 Sep 2009 10:29:04 -0700 (PDT) Organization: http://groups.google.com Lines: 43 Message-ID: <1415ada5-b8fe-444b-8b92-7bc7f52270ff@s21g2000prm.googlegroups.com> References: <2157b29e-a603-4f0d-8028-38c675e51644@o36g2000vbl.googlegroups.com> NNTP-Posting-Host: 63.119.101.66 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1253208544 16106 127.0.0.1 (17 Sep 2009 17:29:04 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 17 Sep 2009 17:29:04 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s21g2000prm.googlegroups.com; posting-host=63.119.101.66; posting-account=QGWcQgoAAADyQ45AEg9sP8lnL-TBY1aZ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)