🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.reader
Article #5245

How do I pass the number of print copies to AcroExch.AVDoc

#5245
From: Jimmy_Huang
Date: Fri, 12 Sep 2008 02:49
38 lines
1731 bytes
Hi,

I have the following function to print a pdf file, but I don't seem to be able to specify the number of copies I want to print, please help! How to set the number of copies to print, thanks a lot!

Sub PrintPDF(ByVal pdfFilePath As String, ByVal numCopyToPrint As Integer)
    'AcroPDF1.Application
    Call GetCommandBarNames
    Dim myAcroApp As AcroApp
    Dim myAVDoc As AcroAVDoc
    Dim PDDoc As AcroPDDoc
    Dim numPages As Integer
    Dim IsSuccess As Boolean

Set myAcroApp = CreateObject("AcroExch.App")
    Set myAVDoc = CreateObject("AcroExch.AVDoc")

myAVDoc.Open pdfFilePath, ""

Set PDDoc = myAVDoc.GetPDDoc
    numPages = PDDoc.GetNumPages

myAcroApp.Show
    'MsgBox "numpages = " & numPages & ", numcopies = " & numCopyToPrint
    'myAVDoc.PrintPages 1, numPages, numCopyToPrint, True, True
    myAVDoc.PrintPages 1, numPages, 2, True, True

'Close the PDF
    myAVDoc.Close True
    myAcroApp.Hide
    myAcroApp.CloseAllDocs
    myAcroApp.Exit

'Cleanup
    Set PDDoc = Nothing
    Set myAVDoc = Nothing
    Set myAcroApp = Nothing

End Sub
Technical Details
Message-ID: <59b67688.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!newsfeed.straub-nv.de!tudelft.nl!txtfeed1.tudelft.nl!news4us.nl!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: 10273d,440411dcd7ad5ac3,start
X-Google-Attributes: gid10273d,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Jimmy_Huang@adobeforums.com
Newsgroups: adobe.reader
Subject: How do I pass the number of print copies to AcroExch.AVDoc
Message-ID: <59b67688.-1@webcrossing.la2eafNXanI>
Date: Thu, 11 Sep 2008 19:49:06 -0700
Lines: 42
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!newsfeed.straub-nv.de!tudelft.nl!txtfeed1.tudelft.nl!news4us.nl!webcrossing