Porting some code from iTextSharp to PdfSharp. In iTextSharp we did this to make the print dialog automatically open when the pdf document is opened in a web browser:
pdfW.AddJavaScript(PdfAction.JavaScript("this.print(true);\r", pdfW));
where pdfW is a PdfWriter
I found this where one of the answers shows opening an existing file with PdfSharp and adding the "open action".
Generate a PDF that automatically prints
I would like to add the open action using MigraDoc to the pdf as its generated. I am using MigraDoc because its at a higher level than PdfSharp. (sections, paragraphs, etc) instead of drawing text and lines)
Also, the pdf is displayed to the user in a browser. Its being sent from an ASP.NET application where the response is the pdf file.