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
-
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 ProcessMyProcess.StartInfo.CreateNoWindow = False
MyProcess.StartInfo.Verb = "print"
MyProcess.StartInfo.FileName = "FILENAME"
MyProcess.Start()
MyProcess.WaitForExit(10000)
MyProcess.CloseMainWindow()
MyProcess.Close()
End IfAlso, 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 -
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 IfBest Regards
Emanuele
0 -
Hello,
how can I get the external pdf in the preview?
Best regards
Levin
0 -
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 -
Hi Lothar,
Thank you for your prompt reply.
Ok that fits too.
regards
Levin
0
Please sign in to leave a comment.
Comments
5 comments