Printing external PDF

Dear all,

using the command LD.AddAttachment([filepath]) in the code of my Report Layout I can attach an external PDF to an email.

But how can I PRINT the same PDF file when I print my Report Layout?

Best Regards

   Emanuele

1

Comments

2 comments
  • 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

    0
    Comment actions Permalink
  • 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
    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post