Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
215 views
in Technique[技术] by (71.8m points)

c# - .NET library to print PDF files

I am after a library which can accept an already created PDF file and send it directly to the printer. I don't want the user to need Adobe Reader or anything else installed, the application will generate a PDF and I want to print it.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Sorry, my first answer (since deleted -- FGITW answer saying just use iTextSharp) assumed it was PDF FAQ #1 when in fact it was PDF FAQ #~5, mea culpa...

There's no system-provided native PDF processing, so outside of using an app such as FoxIt or Acrobat -- which you shouldn't discount too quickly - people who use PDF will have one or the other and will be choosy about which one they prefer as they're not all equal, esp if you get into more advanced features and their associated licensing and monetisation schemes.

Not aware of any specific libraries that address this requirement, though the other question I've linked to above should have a good answer. ... researches; time passes... An answer on the other question says PDFSharp should suit, the sample looks straightforward.

On reflection based on looking at Pdfsharp's FAQ wiki, iTextSharp has similar stuff for generating TIFFs/images as PDFSharp has.

An alternative which may or may not be in scope is to generate and/or convert to e.g., an XPS file, which does have built in printing support (pretty sure .NET 3.5, and possibly earlier have it as a standard component in the Client Profile).

One point that shouldn't be missed in this all is that the Lowagie book (iText In Action) is excellent and if you're going to be doing anything in reading, writing or providing PDF forms, you should have it on your shelf. Similarly, if you do go the FLOSS library route, iText has to be seriously considered.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...