PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

Auto print
http://forum.pdfsharp.com/viewtopic.php?f=2&t=3878
Page 1 of 1

Author:  BrianTheK [ Mon Nov 26, 2018 3:03 pm ]
Post subject:  Auto print

Hi. I'd like to create a pdf using Migradoc and have the print dialog automatically pop up when the pdf is opened. With iTextSharp we used to do:
PdfWriter.AddJavaScript(PdfAction.JavaScript("this.print(true);\r", pdfW));

I found this post on StackOverflow where someone opened an existing pdf and modified it. I'd like to do it as the pdf is created, hopefully with MigraDoc since that is what I am using to create the pdf.

https://stackoverflow.com/questions/616 ... lly-prints

Thanks,
Brian

Author:  TH-Soft [ Mon Nov 26, 2018 7:45 pm ]
Post subject:  Re: Auto print

Hi!
MigraDoc uses PDFsharp to generate the PDF file. You will have to use PDFsharp for special requirements like yours.

You can make the changes after rendering the PDF file with MigraDoc, but before saving it, so the file will be saved only once.
Use the PdfDocument property of the PdfDocumentRenderer class.

https://stackoverflow.com/a/53485593/1015447

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/