Any good PDF export filter that works with Fast Report?

Fabio Gomes picture Fabio Gomes · Jul 27, 2011 · Viewed 10.1k times · Source

I recently discovered that the PDFs exported by the Fast Report's PDF export filter aren't displayed correctly in Mac OSX, iOS and Android devices.

Fast Report informed that their pdf implementation only support Windows and they can't say when the new implementation that they are working on will be available.

I also tried to use the Gnostice export filter, but their demo installer didn't work in Delphi XE and when I contacted them, they took 15 days to send me some attached dcus which also didn't work. So I'm searching for another option.

If you know or use a PDF export filter which works with Fast Report, please let me know.


November 2015: Fast Report now have PDF/A support, with this option enabled the PDFs are fine on all platforms.


October 2014 - Fast Report 5 still seems to generate "Windows-only" PDF. A production-ready solution for this problem would be a benefit for cross-platform developers, given that Fast Report is the report generator bundled with Delphi.

Here is a fresh example generated with the Fast Report 5 demo, displayed with Adobe Reader 11 on Android 4.4:

enter image description here

And on Windows:

enter image description here

Answer

Cosmin Prund picture Cosmin Prund · Jul 27, 2011

Fast Report informed that their pdf implementation only support Windows and they can't say when the new implementation that they are working on will be available.

I'm not sure that should be taken literally, considering PDF is supposed to be a cross platform format. It more likely means they don't actually have the time, equipment or expertise to test with those platforms. The PDF export filter that I'm using is the one built into Fast Report! It surely has some bugs, but I managed to work around them. And I think that might also work for you: Start with a simple document that does export properly, start adding features until it brakes, then you know what brakes it and you'll know how to work around the problem.

From my experience, here's what got me into trouble:

  • Rounded corners in the PDF document didn't look like the ones in the Fast Report preview. My fix: Found a combination of settings that made the exported PDF look exactly like the preview document. For me rounded corners were just a cosmetic feature, and with cosmetics there's no "One Look"; The alternative worked just fine. This might actually be fixed in the most recent version, but I didn't bother changing the document to test.
  • Transparency issues and outline issues. When working with the Fast Report editor (and when looking at it's previews) it's easy to overlap objects. You don't see this because of the object opacity. When exporting to PDF overlapped objects somehow managed to "print" outlines, and it obviously looked ugly. My fix: pay closer attention to those objects, make sure they don't overlap or make sure they don't generate outlines if no outlines are supposed to be seen.

Also make sure you test using ADOBE Reader, on any of the given platforms. If it works with the Adobe reader but doesn't work with other readers, there might be a bug in the 3rd party reader!


Edit: Here (link) is a sample PDF document generated by my Fast Reports application. I have no idea what kinds of documents you generate, but in my book that's a mighty complex document. Notice the diagonal line that starts where the table data ends, notice the embedded images (bar code, stamp, signature).

I opened that document on the following mobile devices:

  • iPad, running iOS: The document renders 90% ok. Images are not rendered at all, but they're not important to my document (and that's very likely a problem with the iOS reader). All the fancy colored lines and rounded corners are properly rendered. Some text is not properly rendered, and I'm pretty sure that didn't render because the "box" that contains it is too small for the contents. That most likely happens because I didn't embed the TTF fonts into the PDF and the Apple font on iOS didn't perfectly match the Microsoft font that was used on Windows.
  • Samsung Galaxy S2, running Android 2.3: The document renders 100% correctly.
  • Samsung Something(??), running Windows Mobile 6.5 and the FoxReader: The document is totally gibberish: pictures showed up but the spacing between letters was messed so bad it's impossible to read. I blame the reader, it's not Acrobat and it probably wanted to be "smart". And it broke it's teeth in my text encoding, because my text is not English.

About the PDF format: A document is "PDF" if it conforms to the standard, here's some Wikipedia info on that. In theory a PDF document should render exactly the same way any way you look at it, but there are forces at play that might work against this:

  • Not all readers are "Adobe Acrobat". In theory they're all compatible, in practice they're most like not 100% compatible.
  • PDFs that don't embed fonts depend on the fonts available on the host system. If they're not the exact same fonts there's trouble ahead, because they might have slightly differing sizes. Since we're talking about PDF's that were generated on Windows and opened on iOS or Android, those are obviously different platforms and they're guaranteed to use different fonts (because fonts are licensed, and I doubt Microsoft will licence it's fonts to Apple. I also doubt Apple would want Microsoft fonts). One possible solution is embedding fonts, but that makes your PDF files significantly larger.