質問

I am using FastReports, and its resulting PDFs cannot be read correctly on iOS. Because iOS reads PDF/A, which FastReports doesn't support. This is apparently a known bug in FastReports 4.0, and it will be fixed in FastReports 5.0. However, 5.0 is a long way away, and has been in development for years by now.

So my simple solution - and I'd prefer a simple as possible solution, so I can remove it again once FastReports 5.0 is out - right now is to simply print the existing PDF to another PDF. Can this be done without installing a PDF printer on the system and just use Delphi?

And if not, is there a converter that accepts PDF files and outputs PDF files?

役に立ちましたか?

解決

Try using SynPDF. It's open source, and its results are good, while managing file size to a very acceptable level. It produces PDF/A docs.

A Fast Report export unit can be found in the following location:

http://synopse.info/forum/viewtopic.php?id=781

他のヒント

I figured out my problem. To solution was to enable embedded fonts in the PDF, as I am using Tahoma and Arial, two fonts which are not available on iOS. I assume I had initially disabled this feature, to save filesize.

But I realise that I am comfortable sending a large file, even to iOS devices. So embedding fonts is the solution for me.

But I would like to give a mention to another answer by yms, which suggests using Helvetica (seeing as Tahoma and Arial are sans serif typefaces) as this is available on most platforms, including iOS. Or - perhaps as I gather from descriptions - part of the PDF engine rather than what lies on the platform.

However, despite this, I still think that to ensure that PDF is truly portable (P in PDF), one should embed all fonts, regardless of their availability. Because - who knows? - you might have some user with a PDF reader that doesn't. Oh and, it only counts for 'simple fonts', not CID fonts. CID fonts must be embedded.

In fact; as far as I understand Arial is an alias for Helvetica in the PDF spec, so it would load Helvetica instead; but it didn't work because it was a CID font.

Creating of PDF is technically editing of a new empty PDFl. The simpliest solution would be to "view PDFs" - render them to TBitmap - then copy it onto the new PDF's TCanvas. But that would kill all vector info... So probably the dummy load -> pretend editing -> save to new file would be able to do it

https://stackoverflow.com/search?q=%5Bdelphi%5D+PDF+edit - a lotta lot of PDF libraries discussed for Delphi, you can download them and try one after another, checking how different libraries fit to the kind and feature-reachness of documents you work with.

I did not marked this question a duplicate only because don't know which one would be best match here.

Delphi, and most high level languages, allow for running subprocesses. You can use that to spawn and control ghostscript. I've successfully used this to read and convert pdfs from various proprietary, and broken, formats into properly constructed, smaller pdfs. There are quite a few options, so you will need to play around with it to get your settings correct.

I've not tried it personally, but Gnostice eDocEngine should do what you want.

http://www.gnostice.com/edocengine_vcl.asp

eDocEngine can create documents in clipboard, PDF, RTF, HTML, XHTML, EXCEL, TEXT, CSV, Quattro Pro, LOTUS 1-2-3, DIF, SYLK, TIFF, PNG, SVG (XML-based vector graphics), JPEG, GIF, BMP, EMF and WMF formats. eDocEngine ships with ready-to-use Report-Export interfaces that tightly integrate with popular Delphi reporting tools such as ReportBuilder, FastReport, Rave, QuickReport, and Ace Reporter.

I was in a similar situation about 12 months ago and ended up buying llpdflib (http://www.llion.net/llpdflib.php) as I couldn't wait any longer for Fast Report VCL 5. It's been working very well producing PDF/A and much smaller sized PDFs.

It's an old post, but we hat the same problem. We solved it with the components from http://www.wptools.de/. A little dll from the tool wpdf generates perfect pdf for windows, ios and android. The files show the font correct and are not so large.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top