14

I'm working on a port of a Delphi app to OSX using FireMonkey. Part of the app displays PDF's, currently using the Acrobat viewer control or Gnostice components under Windows. These options aren't available in FireMonkey for OSX, so I was wondering if anyone had any ideas how to handle this. I have used the Quartz PDFKit PDFView in a Cocoa app but can't see how I could use this in a FireMonkey app.

BumbleB2na
  • 10,723
  • 6
  • 28
  • 30
Kevin McBrearty
  • 265
  • 3
  • 9
  • 1
    Well, if there is no FM PDF viewer available, what I would do is a library that opens an external window with the Quartz one, to be called from the FM app. You loose the skin stuff, but you gain the functionality. May be it helps. – someone Jan 12 '12 at 03:43
  • I'm assuming you can still write custom (OS X specific) code in this environment? Would it be a solution to convert the PDF page you want to display to an image in such custom code and display the image in your FireMonkey created user interface? Creating PDF to images should be fairly simple and this would have the advantage that you don't have to do anything outside your interface... You could even do the same thing on Windows using a library that can convert PDF to images - both open source and commercial libraries are available for that... And that would leave you with cross-platform code:) – David van Driessche Nov 29 '12 at 18:09
  • 1
    Chris Rolliston has a detailed article on his blog about creating a FireMonkey PDF viewer using Core Graphics [link](http://delphihaven.wordpress.com/2012/07/12/osx-pdf-viewer/)...exactly what I was looking for. – Kevin McBrearty Nov 29 '12 at 22:51
  • I think you should answer your own question with that link, and perhaps a bit of salient detail (like the fact that his code wraps the native Cocoa APIs, etc etc). – Warren P May 25 '13 at 23:30

1 Answers1

1

To answer my own question, Chris Rolliston has a detailed article on his blog about creating a FireMonkey PDF viewer. It uses Core Graphics native calls, and has example code for page scrolling and rotation. An excellent start for anyone who needs to do this kind of thing. It was written for XE2 so some things may have changed since.

Kevin McBrearty
  • 265
  • 3
  • 9