Wednesday, July 19, 2006

Foxit...

Nick pointed to this application, Foxit that is a light-weight PDF reader... Well I was digging around the site and found out that they have an SDK that allows you to embed a PDF reader into your application.  They even mention that it is fully usable from Delphi.  It's actually really easy if you look at the... ahem... PDF document on how to call into the DLL.  It's just a simple matter of passing in a DC.  So you could just create a TCustomControl descendant and override the Paint method, and pass the Canvas.Handle property to the FPDF_RenderPage() function.  I wonder if Nick realized that they support Delphi?

12 comments:

  1. I tried foxit reader, and the documents display with poorly. Has anyone had better experiences?

    ReplyDelete
  2. It supports almost any language if it's in a DLL...


    Have look at iSEDQuickPDF - it's written in Delphi. It's a bit slow with complex PDFs but I'm sure it can be optimized. You can even buy full source from them (with a very poor support) for a reasonable price:


    http://www.isedquickpdf.com/

    ReplyDelete
  3. Oliver: I find there is a marginal difference in quality - text is typically slightly smudgier - but the startup time and reduced memory usage more than makes up for it. Typically I use it for the ECMA CLI / C# standards: documents that are largely text, not complex magazine-style layouts.


    The thing that annoys me most with Foxit is that when I select and copy text, it doesn't insert spaces between the words (I would imagine this is something that Adobe Reader guesses based on the physical layout, if that information isn't actually in the PS display model).


    I've been using it for a week or two now, and I'm not going back to Adobe Reader any time soon.

    ReplyDelete
  4. I haven't tested it myself, I've heard good things about Foxit from another developer.


    I don't know about uber complex pdfs, but apparently for simple text and things like invoices, it is fine.


    I have worked with Acrobat's PDF OCX, and I did not find it the cleanest thing in the world if you are creating and destroying it at run time (although, this is probably more to due with its COM nature more than anything)

    ReplyDelete
  5. For me, the best way to embed PDF-documents in an application, is use the TWebBrowser and load a PDF-file in this webbrowser.


    It even works for MS Office documents..

    ReplyDelete
  6. Adobe Acrobat (not Reader) is really easy to drive from your program. I used it a decade ago from PowerBuilder (this was Acrobat 2 and 3, btw.) It used a COM interface and you just pointed it at the window you wanted it to display in. Reader's not nearly as functional. (You could do it with a plug in, if the license didn't specifically forbid it.)

    ReplyDelete
  7. We use the SDK and have found it to be the as good for viewing as pulling up Adobe itself (not sure where the smudging your getting is coming from, maybe its your PDF). We needed a way for our people to view proprietary instructional techinical documents (some that are "black box" or NDA parts) but not be able to print, email, copy etc. We worked out a deal with the Foxit guys to be able to distribute the DLL within our company (100 + shop floor pcs) for a minimal fee. Works fantastic. Using it with Delphi 7 and BDS2006.

    ReplyDelete
  8. I use Foxit now. I've uninstalled Acrobat Reader 10 minutes after my first try with Foxit. I'm very pleased with it.


    The only difference I see in the display is the image quality, but I can live with it. I use it to read The Delphi Magazine or SD Times without problems.


    The fact that they support Delphi is nice too.

    ReplyDelete
  9. Visagesoft eXPert PDF Viewer (ActiveX with some Delphi example code) seems to work as about as well as Foxit and their licensing fees are about 1/2 to 1/3. Gnostice & Wpcubed have PDF viewers too, but I didn't find the rendering nearly as good as the first two (in my totally unscientific test of opening up a few, complex documents).

    ReplyDelete
  10. I have been using it the past few days. On my computer the load time is not that much different to Adobe's, I am using Adobe's speed launch. But it is crashing often when paging down documents.

    ReplyDelete
  11. Another alternative to using Acrobat is Nitro PDF. It's basically got all of the functionality that you find in the standard Acrobat but at a fraction of the cost and without the Adobe bloat. Nitro rendering is at least on par with Foxit, maybe even a little better.


    I was looking at using Nitro in my application and came across this tip in their forum that uses the IE browser control to embed the Nitro viewer (similar to what Bas Groot noted in his comment) -> http://www.nitropdf.com/forums/forums/1189/ShowPost.aspx.

    ReplyDelete
  12. Nitro rendering cannot be better than Foxit because Nitro uses the Foxit rendering technology. Not many companies have their own rendering technology.

    ReplyDelete

Please keep your comments related to the post on which you are commenting. No spam, personal attacks, or general nastiness. I will be watching and will delete comments I find irrelevant, offensive and unnecessary.