Skip to main content

Printing external PDF

Comments

5 comments

  • Permanently deleted user

    Hi Emanuele,

     

    you can print the PDF-file if you add this code to the GenerateScript of the document:

    'Print Document
    If Engine.isDoublePass Then

    Dim MyProcess As New Process

    MyProcess.StartInfo.CreateNoWindow = False
    MyProcess.StartInfo.Verb = "print"
    MyProcess.StartInfo.FileName = "FILENAME"
    MyProcess.Start()
    MyProcess.WaitForExit(10000)
    MyProcess.CloseMainWindow()
    MyProcess.Close()

    End If

     

    Also, please add System.Diagnostics to Imports.

    You can replace FILENAME with the path and the filename of your PDF, and your PDF should be printed with your layout.

     

    Best Regards

    Karsten

    1
  • Emanuele Croci

    Dear Karsten,

    yesterday evening I found a similar code to print an external pdf:

    If Engine.IsDoublePass Then
      ' only one time
      If GetData("LD.Par.PrintMode") = "N" And GetData("LD.Par.Preview") = "N" Then
        ' if in print mode, and it's not a preview
        Dim MyProcess As New System.Diagnostics.Process
        MyProcess.StartInfo.CreateNoWindow = False
        MyProcess.StartInfo.Verb = "print"
        MyProcess.StartInfo.FileName = "C:\Users\Emanuele\Documents\Documentazione\Coresuite\xyz.pdf"
        MyProcess.Start()
        MyProcess.WaitForExit(10000)
        MyProcess.CloseMainWindow()
        MyProcess.Close()
      End If  
    End If

    Best Regards

        Emanuele

    0
  • Levin Efinger

    Hello, 

    how can I get the external pdf in the preview? 

    Best regards 

    Levin

    0
  • Lothar Hasenkämper

    Hi Levin,

    as far as I know, you can't add the pdf into the preview.

    You can open it like described above in an external viewer.

    regards

    Lothar

    1
  • Levin Efinger

    Hi Lothar, 

    Thank you for your prompt reply.

    Ok that fits too. 

    regards 

    Levin

     

    0

Please sign in to leave a comment.