#1 2020-01-28 02:56:06

erick
Member
Registered: 2015-09-09
Posts: 155

OpenData format to PDF

Hi,

SynPDF is great, but I didn't want to spend time programming the page layout.  So
I created a tool which creates Rich PDF documents suitable for mORMot database applications using simple Word processed templates.

You or your client creates a template for the document in Word or almost any other word processing document.
It can include different font sizes and bold, as well as tables.  Save it as an ODT file.

Then use ODF2PDF to read that ODT file, perform a mailmerge replacing data like names, etc. in the file (variables are defined as %%variable%%) with your application-defined values, and write out a PDF file, or save to stream in the case of a web server.

This is still an early version, I haven't added JPEG support yet for example, but it may prove useful for others.

You can download the souce and sample at http://www.eng.uwaterloo.ca/~erick/odf2pdf.zip

It uses SynZIp and SynPDF as helper libraries.

Erick

Offline

#2 2020-01-28 02:57:49

erick
Member
Registered: 2015-09-09
Posts: 155

Re: OpenData format to PDF

I couldn't get Encryption to work, it wouldn't even compile.  I'm probably missing something simple.  I would need encryption, so any suggestions welcome.

The only supported attributes for the library are bold, font-size and tables.  Sorry, that was all I needed for my application. 

I just whipped it up in a day so it's a bit rough, but there are at least no memory leaks for the example ODT file.

I only tested on Letter sized paper.  The margin defaults are hard coded for Letter for now. 

Erick

Last edited by erick (2020-01-28 03:00:51)

Offline

Board footer

Powered by FluxBB