Display a PDF in a Windows C# program.
-
I'm building kiosk software where we need to be able to display a PDF file. Because this is a kiosk, there is no user interaction which means that it is filled with issues. What do you do with multiple pages, we are displaying on a plasma so the aspect ratio is wrong which means there will be black bars, we'd like to not have any menus since they take up real estate. So does anybody have any ideas? One we came up with was to convert the document to jpgs, one page per image, and then scroll through them. This works but the library I looked at (http://www.aspose.com/) is slow (about 2 seconds a page). I've also looked at the Adobe ActiveX control (just started looking at it) but we've had issues before where Adobe wants to update itself and puts a message on the screen. So does anybody have any suggestions/thoughts on this? TIA - Jeff.
-
I'm building kiosk software where we need to be able to display a PDF file. Because this is a kiosk, there is no user interaction which means that it is filled with issues. What do you do with multiple pages, we are displaying on a plasma so the aspect ratio is wrong which means there will be black bars, we'd like to not have any menus since they take up real estate. So does anybody have any ideas? One we came up with was to convert the document to jpgs, one page per image, and then scroll through them. This works but the library I looked at (http://www.aspose.com/) is slow (about 2 seconds a page). I've also looked at the Adobe ActiveX control (just started looking at it) but we've had issues before where Adobe wants to update itself and puts a message on the screen. So does anybody have any suggestions/thoughts on this? TIA - Jeff.
Just a thought...
jbradshaw wrote:
One we came up with was to convert the document to jpgs, one page per image, and then scroll through them. This works but the library I looked at (http://www.aspose.com/) is slow (about 2 seconds a page).
Is the PDF generated dynamically by software you don't control? Can you just create the JPEG's in advance (once, when you write the software), then display those and not have to worry about PDF's? And why does speed matter that much? Can't you just convert the PDF in advance (i.e., right before it's needed), then you'll have each page as a JPEG to scroll as you please? Also, any reason you chose JPEG? Do your PDF's contain natural type images (e.g., photography), or does it contain just text? If just text, PNG may be a more ideal format (lossless and compresses very well with computer generated images). I did some Googling and came across ImageMagick, which apparently converts images and supports PDF as an input format (note that, for PDF's, it says it requires Ghostscript).
-
I'm building kiosk software where we need to be able to display a PDF file. Because this is a kiosk, there is no user interaction which means that it is filled with issues. What do you do with multiple pages, we are displaying on a plasma so the aspect ratio is wrong which means there will be black bars, we'd like to not have any menus since they take up real estate. So does anybody have any ideas? One we came up with was to convert the document to jpgs, one page per image, and then scroll through them. This works but the library I looked at (http://www.aspose.com/) is slow (about 2 seconds a page). I've also looked at the Adobe ActiveX control (just started looking at it) but we've had issues before where Adobe wants to update itself and puts a message on the screen. So does anybody have any suggestions/thoughts on this? TIA - Jeff.
If Aspose is too slow, here's another library you might want to try: GDPicture.NET[^] I haven't used it in any projects yet, but I did try it for a proof-of-concept to create a pdf from a composite image. It wasn't too hard to use and got the job done.
-
If Aspose is too slow, here's another library you might want to try: GDPicture.NET[^] I haven't used it in any projects yet, but I did try it for a proof-of-concept to create a pdf from a composite image. It wasn't too hard to use and got the job done.