How to print a PDF with C#

前端 未结 11 577
抹茶落季
抹茶落季 2020-12-14 17:58

I´ve trying to solve this problem for nearly 2 days. There are a lot of more or fewer good solutions on the net, but not a single one fits my task perfectly.

11条回答
  •  借酒劲吻你
    2020-12-14 18:23

    The most flexible, easiest and best performing method I could find was using GhostScript. It can print to windows printers directly by printer name.

    "C:\Program Files\gs\gs9.07\bin\gswin64c.exe" -dPrinted -dBATCH -dNOPAUSE -sDEVICE=mswinpr2 -dNoCancel -sOutputFile="%printer%printer name" "pdfdocument.pdf"

    Add these switches to shrink the document to an A4 page.

    -sPAPERSIZE=a4 -dPDFFitPage

提交回复
热议问题