有什么好的 PDF 导出过滤器可以与 Fast Report 配合使用吗?

发布于 2024-11-26 17:29:01 字数 770 浏览 2 评论 0原文

我最近发现 Fast Report 的 PDF 导出过滤器导出的 PDF 在 Mac OSX、iOS 和 Android 设备中无法正确显示。

Fast Report 告知他们的 pdf 实现仅支持 Windows,他们无法透露他们正在开发的新实现何时可用。

我还尝试使用 Gnostice 导出过滤器,但他们的演示安装程序在 Delphi XE 中不起作用,当我联系他们时,他们花了 15 天才给我发送了一些附加的 dcus,但也不起作用。所以我正在寻找另一种选择。

如果您知道或使用可与 Fast Report 配合使用的 PDF 导出过滤器,请告诉我。


2015 年 11 月:Fast Report 现在支持 PDF/A,启用此选项后,PDF 可以在所有平台上正常运行。


2014 年 10 月 - Fast Report 5 似乎仍然生成“仅限 Windows”的 PDF。鉴于 Fast Report 是与 Delphi 捆绑在一起的报告生成器,针对此问题的生产就绪解决方案将有利于跨平台开发人员。

以下是使用 Fast Report 5 演示生成的新示例,在 Android 4.4 上使用 Adob​​e Reader 11 显示:

在此处输入图像描述

在 Windows 上:

在此处输入图像描述

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

谈情不如逗狗 2024-12-03 17:29:01

Fast Report 告知他们的 pdf 实现仅支持 Windows,他们无法透露他们正在开发的新实现何时可用。

我不确定这应该从字面上理解,因为 PDF 应该是一种跨平台格式。这更有可能意味着他们实际上没有时间、设备或专业知识来测试这些平台。我使用的 PDF 导出过滤器是 Fast Report 中内置的过滤器!它肯定有一些错误,但我设法解决了它们。我认为这也可能对您有用:从一个可以正确导出的简单文档开始,开始添加功能直到它停止,然后您知道是什么停止了它,并且您将知道如何解决问题。

根据我的经验,这就是给我带来麻烦的原因:

  • PDF 文档中的圆角看起来不像快速报告预览中的圆角。我的修复:找到了一些设置组合,使导出的 PDF 看起来与预览文档完全相同。对我来说,圆角只是一种装饰特征,而对于装饰来说,没有“One Look”;它是一种装饰。另一种方法效果很好。这实际上可能在最新版本中得到修复,但我没有费心更改文档进行测试。
  • 透明度问题和大纲问题。使用快速报告编辑器(以及查看其预览时)很容易重叠对象。由于对象不透明,您看不到这一点。当导出到 PDF 时,重叠的对象以某种方式设法“打印”轮廓,而且它看起来显然很难看。我的解决方法:密切注意这些对象,确保它们不重叠,或者确保它们不会生成轮廓(如果没有轮廓应该被看到)。

另请确保在任何给定平台上使用 ADOBE Reader 进行测试。如果它适用于 Adob​​e 阅读器但不适用于其他阅读器,则第 3 方阅读器可能存在错误!


编辑这里(链接)是生成的示例 PDF 文档通过我的快速报告应用程序。我不知道你生成了什么类型的文档,但在我的书中,这是一个非常复杂的文档。注意从表格数据结束处开始的对角线,注意嵌入的图像(条形码、印章、签名)。

我在以下移动设备上打开该文档:

  • iPad,运行 iOS:文档呈现 90% 正常。图像根本不渲染,但它们对我的文档并不重要(这很可能是 iOS 阅读器的问题)。所有花哨的彩色线条和圆角均得到正确渲染。某些文本未正确呈现,我很确定未呈现,因为包含它的“框”对于内容来说太小了。发生这种情况很可能是因为我没有将 TTF 字体嵌入到 PDF 中,并且 iOS 上的 Apple 字体与 Windows 上使用的 Microsoft 字体不完全匹配。
  • Samsung Galaxy S2,运行 Android 2.3:文档呈现 100% 正确。
  • Samsung Something(??),运行 Windows Mobile 6.5 和 FoxReader:该文档完全是乱码:显示了图片,但字母之间的间距混乱得无法阅读。我责怪读者,它不是 Acrobat,它可能想变得“聪明”。它在我的文本编码中打破了它的牙齿,因为我的文本不是英语。

关于 PDF 格式:如果文档符合标准,则为“PDF”,这里有一些 Wikipedia相关信息。理论上,无论您以何种方式查看 PDF 文档,其呈现方式都应完全相同,但有些力量可能会阻碍这一点:

  • 并非所有读者都是“Adobe Acrobat”。理论上它们都是兼容的,但实际上它们很可能不是 100% 兼容。
  • 不嵌入字体的 PDF 取决于主机系统上可用的字体。如果它们不是完全相同的字体,就会遇到麻烦,因为它们的大小可能略有不同。由于我们谈论的是在 Windows 上生成并在 iOS 或 Android 上打开的 PDF,因此这些显然是不同的平台,并且保证它们使用不同的字体(因为字体已获得许可,我怀疑 Microsoft 是否会将其字体许可给 Apple。我也怀疑苹果会想要微软字体)。一种可能的解决方案是嵌入字体,但这会使您的 PDF 文件明显变大。

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.
暖树树初阳… 2024-12-03 17:29:01

据我所知,您可以将快速报告页面导出为图元文件(即矢量 Windows 格式,实际上是 GDI 命令的原始序列化)。

然后,您可以使用我们的开源 SynPDF 库将这些图元文件呈现为 PDF。它适用于 Delphi 5 到 XE,支持 Unicode,可以嵌入 True Type 字体,甚至可以创建 PDF/A 文件。

它还能够将报告中包含的图元文件导出为矢量图片(而不是位图),因此可以大大提高 pdf 质量,同时缩小其大小。

例如,请参阅如何将其用于 QuickReport。 Fast Report 应使用类似的技术。

AFAIK you can export your Fast Report pages as metafiles (i.e. vectorial Windows format, which is in fact a raw serialization of GDI commands).

Then you could be able to render those metafiles into PDF using our Open Source SynPDF library. It works from Delphi 5 up to XE, is Unicode ready, can embed true type fonts, and even create PDF/A files.

It is also able to export metafiles included in reports as vectorial pictures (and not bitmaps), and could therefore highly increase the pdf quality and at the same time shrink its size.

See for instance how it can be used for QuickReport. A similar technical should be used with Fast Report.

七婞 2024-12-03 17:29:01

Gnostice 支持回复了我的电子邮件,我报告说他们的试用安装程序无法正常工作,并向我发送了一些有关可能出现问题的提示,我能够安装它。

我工作的公司已经为我购买了许可证,并且我已经更换了快速报表导出过滤器,这是一项简单的任务,只需将 2 个组件放在与 frxReport 对象相同的表单上并设置 2 或 3 个属性即可。

此外,以编程方式导出报告也需要 2 行代码,并且可以在常见问题解答中轻松找到该信息。

最后,根据建议并寻找其他选项只是为了找到多年来没有任何更新的废弃组件,Gnostice eDocEngine 是最佳解决方案。

只是希望他们让他们的安装程序更加“程序员友好”,就好像它抱怨搜索路径中缺少快速报告的单位一样,我至少能够了解正在发生的事情,而不仅仅是收到错误并指责他们有一个不起作用的试用安装程序。

更换过滤器并使用 eDocEngine 组件生成 PDF 后,PDF 现在在 iOS、OSX 和 Android 中的工作方式相同。

The Gnostice support answered my e-mail which I reported that their trial installer didn't work and send me some tips about which could be the problem and I was able to install it.

The company I work for already bought me a license and I already replaced the Fast Report Export Filter, which was a task as simple as droping 2 components on the same Form as the frxReport Object and setting 2 or 3 properties.

Also, to export the report programatically was also 2 lines of code and the information was easily found in their FAQ.

In the end, based on the recomendations and after looking for other options just to find abandoned components which doesn't have any updates for years, the Gnostice eDocEngine was the best solution.

Just hope they make their installer a little more "Programmer Friendly" as if it had complained about the lack of Fast Report's units in the search path I would've been able to at least have an idea of what was going on, instead of just getting an error and blaming them for having a trial installer which didn't work.

After replacing the filter and generating the PDF's using the eDocEngine component, the PDFs now work the same in iOS, OSX and Android.

沧桑㈠ 2024-12-03 17:29:01

这是我的解决方案。这不是通用的,但对我的情况有帮助。
主要思想:在小文件大小的报告字体中使用(我发现了类似 Arial 的字体,带有西里尔字符集,大小为 57kb)。所以导出的文件可以是100-200 kb。
详细信息在这里:
http://dev-doc .blogspot.com/2013/03/fastreport-4-font-reading-and-huge-file.html

Here is my workaround solution. It's not an universal one, but helped me in my case.
The main idea: use in report font with small file size (I've found Arial-like font with cyrillic charset with size 57kb). So the exported files can be 100-200 kb.
Details is here:
http://dev-doc.blogspot.com/2013/03/fastreport-4-font-reading-and-huge-file.html

冰葑 2024-12-03 17:29:01

我使用 WPcubed 组件中的 wPDF,它确实是一个很棒的产品,物有所值

I use wPDF from WPcubed components, it's really a great product, good value for money

北渚 2024-12-03 17:29:01

您始终可以安装一台 PDF 打印机。这些实际上是作为 Windows 打印机安装的 PDF 转换器。它们可以在任何应用程序(包括 FastReprt 组件)上工作 - 只需在其上打印即可。

You can always install one of the PDF printers. These are in fact PDF convertors that install as windows printer. They work from any application including FastReprt components - just print on them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文