I need to create a software which will create print previews of the documents of following formats: the MS Office documents (.doc(x)
, .ppt(x)
, .xls(x)
), images, .txt
files and PDF files. I have made a working prototype using XPS
files. So basically I do the following: I convert the office files to .xps
using Office Automation and then I render the .xps
documents to images. I simply create XPS files from images and .txt
by adding text or an image to FlowDocument
, then rendering it. But I have found out that there is no way to convert PDF to XPS fast (A document which has 600 pages takes more than 2 minutes to convert and this is totally not suitable). So I am stuck at this point. It seems that I should start over again, using the different file format. Should I rewrite my program using PDF, for example, or is there any other way to accomplish my task? And if I should use PDF, could you, please, suggest me a good PDF C# library to render previews of pages as fast as possible? I tried using Websupergoo's ABCPdf, but it is too slow, because it does not allow me to render the previews to System.Windows.Media.Imaging.BitmapSource
, only System.Drawing.Bitmap
, so I have to convert Bitmap
to BitmapSource
and it takes up a lot of time.
Thanks in advance.
Asked
Active
Viewed 585 times
1

Cracker
- 912
- 2
- 14
- 26
1 Answers
1
Use Ghostscipt to convert PDF to images. Though, I don't know why you wouldn't just use the PDF. I have used GhostScript for a number of PDF/Image manipulation tasks.
http://www.wibit.net/blog/integrating_ghostscript_c
Ghostscript will output any PDF to images to the settings you specify. I think you can use it as a DLL or as a commandline process.

FlavorScape
- 13,301
- 12
- 75
- 117
-
Could you suggest me a good PDF .NET library for fast page rendering? – Cracker Nov 07 '12 at 09:11
-
Is this WPF or winforms? This quesion may be useful http://stackoverflow.com/questions/55083/opening-a-pdf-in-wpf-application – FlavorScape Nov 08 '12 at 01:43
-
The application is using WPF. – Cracker Nov 08 '12 at 08:31