print existing pdf particular page based on criteria

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kkshansid
    New Member
    • Oct 2008
    • 232

    print existing pdf particular page based on criteria

    i want to print existing pdf particular page based on employee id and save that id and print date in database .i somehow got the code to open and print whole pdf file.kindly help me to pass an argument to pdf file which opens and print that page only.
    thanks in advance

    Code:
    Sub testpdfprint()
    Print_PDF ("C:\letter.pdf") 'Put your PDF in here
    End Sub
     
     
    Sub Print_PDF(sDocumentFullPath As String)
    Dim sAcrobatReaderExe As String ' full path to the Acrobat reader executable
    sAcrobatReaderExe = "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" 'Change this to where AcroRd32.exe is on your machine
    RetVal = Shell(sAcrobatReaderExe & " /P " & Chr(34) & sDocumentFullPath & Chr(34), 0)
    End Sub
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    There is no command line option to print a specific page.

    Comment

    • zmbd
      Recognized Expert Moderator Expert
      • Mar 2012
      • 5501

      #3
      Perhaps the following documentation will help:

      Parameters for Opening PDF Files
      (...)The parameters for URLs are supported by most browsers, and can be used when opening PDF documents programmaticall y.
      Many of these parameters can be passed to the following core API functions (see the Acrobat and PDF Library API Reference for details):
      AVDocOpenFromFi leWithParamStri ng
      AVDocOpenFromAS FileWithParamSt ring
      AVDocOpenFromPD DocWithParamStr ing
      When opening a PDF document from a command shell, you can pass the parameters to the open command using the /A switch with the following syntax:
      <Acrobat path> /A "<parameter>=<v alue>" "<PDF path>"
      For example:
      Acrobat.exe /A "zoom=1000" "C:\example.pdf "
      In Mac OS, you can use the parameters when opening a PDF document with an Apple event.(...)

      Comment

      Working...