#1 2019-09-06 11:15:26

RoyLambert
Member
Registered: 2015-03-22
Posts: 4

TMWPrintObject Component

I'm working on an application that uses the freeware MWPrintObject component for reporting. Its nice and lightweight and from what's been done does a nice job. My normal approach to producing PDF output is to install a PDF printer driver like PDF995 but I've been asked to enhance this application to not require a driver.

I don't want to have to rewrite all the reports and SynPDF looks as though I can bolt it in to produce PDF.

I've looked at the examples but I'm doing something wrong because I keep crashing the PC.

MWPrintObject can write its output to a canvas so I've given it a bitmap to write to and if I keep things to a single page things work. When I try and produce multiple pages is when I get crashes. I've looked at the examples I can find but no joy.

Is there a way of producing multi page PDFs from multiple instances of a bitmap, or from multiple bitmaps?

Offline

#2 2019-09-06 16:10:52

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,206
Website

Re: TMWPrintObject Component

In Canvas compatibility mode, SynPDF is expected to render its pages not from a bitmap, but from a EMF vectorial metafile.
In short, you just draw into a TMetaFileCanvas, then you render it using SynPDF.

The easiest is to look how mORMotReport.pas work, and also TestSQLite3Pages.dpr sample located in "05 - Report created from code" folder.

Offline

#3 2019-09-07 07:36:56

RoyLambert
Member
Registered: 2015-03-22
Posts: 4

Re: TMWPrintObject Component

Thanks

Offline

Board footer

Powered by FluxBB