PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Dec 10, 2018 10:08 pm

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 
Offline

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

Thanks,
Brian


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

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

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


Top
 Profile  
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: Baidu [Spider], Google [Bot] and 2 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