tags:

views:

257

answers:

6

I have a client that has a requirement to display PDFs directly within a desktop application. Apparently it is not acceptable to use Adobe Reader or some other 3rd party viewer.

To complicate this, the app needs to run on both Windows and Mac OS X.

Does anyone know of ways to do this? I'd prefer a cross-platform solution, but separate solutions for Windows and OS X might also work.

I'm not tied to any particular development environment just yet for this, but Mac/Windows support is important.

+3  A: 

foxit reader SDK supports both platforms, but is a bit limited (just generates bitmaps of the PDF so no interaction, etc.) Adobe has an SDK as well.

Alternatively you can try to host Acrobat within your application using the plugin API, the same way Internet Explorer / Firefox / etc does. However I have no idea how that works on a Mac.

adzm
+3  A: 

Adobe provides acropdf.dll on windows. It allows you to embed a PDF viewer in any COM capable environment on Windows. They may provide something similar on the Mac. There are several 3rd party libraries for displaying PDFs. I'm using GD Viewer on a project and it seems to be working pretty well.

Jim Blizard
A: 

Replicating full PDF rendering is very probably too complicated to be worthwhile. IIRC the PDF spec has had things like 3D rendering in it since Adobe Reader version 7. Adobe is supplying a PDF toolkit that does what you want, but that requires COM interaction with the reader.

You might be able to supply it with your application though, have a look at the EULA. Have a look at the kit. At the developer center you should easily be able to find out if it meets your needs.

mstrobl
+1  A: 

On the OS X side of things, Cocoa has the PDFKit framework which is extremely easy to use. Just drop a PDFViewer onto your nib, give it a PDFDocument with the correct filename, and you're done. Preview.app is built around PDFKit, and nearly everything you see there you get "for free" in your own application.

Marc Charbonneau
+1  A: 

What about using Adobe Air to display the PDFs from a local source?

Link to the SDK

somacore
+1  A: 

PDFTron SDK is available on Windows/Linux/Mac As a starting point, check out PDFViewSample sample http://www.pdftron.com/pdfnet/samplecode.html#PDFViewSimple

Ivan