PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Feb 26, 2021 1:38 am

All times are UTC

Forum rules

Please read this before posting on this forum: Forum Rules

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Auto print
PostPosted: Mon Nov 26, 2018 3:03 pm 

Joined: Wed Nov 21, 2018 5:48 pm
Posts: 13
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


Reply with quote  
 Post subject: Re: Auto print
PostPosted: Mon Nov 26, 2018 7:45 pm 
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 623
Location: CCAA
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.


Best regards
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: Google [Bot] and 16 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group