#1 2026-09-12 07:48:02

mdoyle
Member
Registered: 2020-11-29
Posts: 28

mORMot PDF crossplatform

I’ve been a big fan of mORMot for a long time, and I’ve used the PDF engine extensively over the years. It’s a powerful library, and I really appreciate how much it can do.

Recently, with the move to Lazarus on macOS and Linux, I became especially interested in a cross-platform solution for PDF generation and reporting. That led me to build and refine a project that abstracts the platform-specific parts and works across those environments.

This is a very complex library, so I relied heavily on Claude to help with the porting and integration work. It has been extremely useful in navigating the complexity and getting the cross-platform pieces to fit together cleanly.

The project currently includes 6 example files that demonstrate the main use cases and APIs:

direct PDF generation,
TCanvas-style usage,
report generation,
markdown/export flow,
CJK support,
RTL/Arabic text handling.

You can find the project on https://github.com/martin-doyle/mORMot2 … ssPlatform.

I’d love to hear whether this kind of cross-platform mORMot PDF/reporting project is of interest to others in the community. If there is interest, I’d be happy to share more details and examples.

Martin

Offline

#2 2026-09-13 09:47:05

edwinsn
Member
Registered: 2010-07-02
Posts: 1,230

Re: mORMot PDF crossplatform

@Martin, thanks for sharing, it must be very helpful.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#3 2026-09-14 08:08:17

flydev
Member
From: France
Registered: 2020-11-27
Posts: 205
Website

Re: mORMot PDF crossplatform

thanks! good timing, I've just been asked to add report generation and pdf export on our backend, and I never touched the pdf side of mormot until now. will give it a try this week.

Offline

#4 2026-09-15 13:00:37

JD
Member
Registered: 2015-08-20
Posts: 132

Re: mORMot PDF crossplatform

@mdoyle Thank you so much for sharing your work.

Offline

#5 Yesterday 19:11:33

mdoyle
Member
Registered: 2020-11-29
Posts: 28

Re: mORMot PDF crossplatform

Besides the cross-platform support, creating accessible PDFs was a design goal. Since the European Accessibility Act came into force on 28 June 2025, accessibility is mandatory for many PDFs published online (and it has been required for public-sector bodies for even longer).

I've made a few adjustments so that most of the examples now pass an accessibility test, carried out with the German testing tool PAC. All demos except the Chinese and RTL ones now run through the tests without any errors.

Offline

#6 Today 03:57:42

EduardAppelhans
Member
Registered: 2020-04-14
Posts: 15

Re: mORMot PDF crossplatform

I‘m wondering if it might be reasonable to combine this solution with Sh17/Sven Harazim/ Landrix Zugpferd for Delphi solution.

The idea is to use it on top of an existing invoice generating mormot2 SOA Service with fast report to enhance it submitting cross platform PDF Zugpferd capabilities. Would this approach generally be advisable?

Last edited by EduardAppelhans (Today 04:51:39)

Offline

#7 Today 19:15:34

mdoyle
Member
Registered: 2020-11-29
Posts: 28

Re: mORMot PDF crossplatform

Thanks for the question, it touches on something I've been thinking about as well.

Short answer: invoice generation itself is out of scope for this project, but PDF/A-3 with file attachments is something I will look into.

A few thoughts on your setup:

- If FastReport renders your invoices, the PDF comes from FastReport's own exporter. Since this PDF engine can't modify existing PDFs, you would need to render the layout with TGDIPages instead, or check whether FastReport itself supports PDF/A-3 attachments.

- This library could provide the generic container: PDF/A-3 with embedded files like Landrix XML invoice library, combined with the existing PDF/UA tagging.

I'll put PDF/A-3 with attachments on the roadmap as a future item and validate it. By the way, a real-world invoice layout would make an excellent test case.

Offline

#8 Today 20:16:55

EduardAppelhans
Member
Registered: 2020-04-14
Posts: 15

Re: mORMot PDF crossplatform

Thanks for your answer!

Offline

Board footer

Powered by FluxBB