#1 2021-10-14 09:18:24

Topo Calcaire
Member
Registered: 2021-10-14
Posts: 1

Error when drawing a Bitmap in a TPdfDocumentGdi

Hello,

I have made an application to draw plans and I want to save also the drawings in a pdf file.
I use a TPdfDocumentGdi.vclcanvas to do that. If I draw a bitmap in this document with the function copyrect, it works well for a A4 paper size (with ScreenLogPixels = 600), but for larger sizes, there is an error "out of memory" when I want to save the PDF File.
Is there a solution to this problem ?

Thanks

Offline

#2 2021-10-14 15:22:34

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

Re: Error when drawing a Bitmap in a TPdfDocumentGdi

It is a Windows restriction: your bitmap is just too huge.

What I would do is rather not to write a bitmap but a vectorial meta file - via a TMetaFileCanvas. The PDF would be very small and also will perfectly scale to any resolution.

Otherwise, don't change ScreenLogPixels, just use a small value. But the picture will be pixelized.

Offline

Board footer

Powered by FluxBB