#1 Re: PDF Engine » Using PDF Engine in TPrintPreview and a problem i entered » 2010-07-23 15:01:07

ab wrote:

About TPrintPreview, did you see our SynGdiPlus library? There is a way of rendering metafiles with GDI+, i.e. with Anti-Aliaising and smooth drawing. I guess TPrintPreview use TMetaFile to store and render its pages during preview, so perhaps using SynGdiPlus as rendering engine could improve the output. See how it works in our SQLite3Pages unit, which core is more or less the same as a TPrintPreview, but oriented more as a report generating tool.

I will take this in consideration. First i want to make sure that the change to SynPDF is working out well.
Thanks for you comments!

Martijn

#2 Re: PDF Engine » Image position when creating PDF from EMF » 2010-07-21 18:49:27

I had the same problem but in the source control you can find a version which is fixed.

(log in to source control anonymous, select leaves and last version te get a zip with all units of the latest version)

#3 Re: PDF Engine » Using PDF Engine in TPrintPreview and a problem i entered » 2010-07-21 15:08:56

ab wrote:

Issue found and fixed. Uploaded to our Source Code repository.

SynPdf Version 1.8.8
  - fix small issue with font orientation in metafile enumeration

Thank you, it works like a sharm now :-)

ab wrote:

You're still creating your page using bitmaps. Or your software seems to create vectorial graphics: isn't there any way of creating the drawings using vectorial GDI commands instead of bitmaps? Perhaps I'm wrong and your pics are bitmaps.

The original images are also bitmaps, most of the images are bitmaps, but maybe i can change the way 1800 of the 13000 pictures are handled (those pictures are wmf files and i could handle them that way instead of painting them to a bitmap internally)

I can also change the way the text pictos are created internally, that way they will be much smaller in the resulting pdf and better zoomable.

I'm now testing it more but it looks very promising!!!

Martijn

#4 Re: PDF Engine » Using PDF Engine in TPrintPreview and a problem i entered » 2010-07-20 20:26:03

I've also send my changes in Print Preview to the Print preview forum. So you might see some traffic from it :-)
( http://forum.delphiarea.com/viewtopic.php?f=7&t=1827 )

#6 Re: PDF Engine » Using PDF Engine in TPrintPreview and a problem i entered » 2010-07-20 13:21:40

This is much better indeed :-) up to the next problem i just found :-(

I've updated the file above with another emf the preview created. The text that is on the right side (with an angle of 90 deg) is not rotated in the pdf.

Thanks a lot for fixing the bitmap problem, i think the rotation error is the only error left. When that works ok i expect to be able to replace the pdf creator in TPrintPreview....

#7 Re: PDF Engine » Using PDF Engine in TPrintPreview and a problem i entered » 2010-07-20 07:19:36

ab wrote:

I just looked at the emf file generated.

It just a bunch of StretchDiBits... it's not optimized for generating a PDF! PDF prefers vectorial data as bitmap.

I know, but that the way that TPrintPreview works: it creates a metafile for each printed page. The other solution would be to paint directly to the pdf which is better to keep the original optimalizations (and images / texts) but requires a lot more rewriting.

ab wrote:

I'm not sure you're taking the PDF generation from the right side... I think it's worth looking after vectorial meta file generation, instead of these bitmaps.

Perhaps the  EMR_SETSTRETCHBLTMODE  action should be implemented in the engine: it was not used yet.

If you can make it work for your content, please share!

If i make it work then i will surely share it. But i'm looking for several solutions now of the problem that on some systems the original pdf solution of TPrintPreview is failing...

Martijn

#8 PDF Engine » Using PDF Engine in TPrintPreview and a problem i entered » 2010-07-19 20:04:12

PictoSelector
Replies: 11

Hi,

This PDF Engine is promising, but maybe not complete. But of course i could do something wrong here :-)

The issue i'm facing:
I want to use the PDF Engine in the excellent TPrintPreview of delphi area (http://www.delphiarea.com/)

That is not that difficult, but my output is wrong, the images in it are 'printed' overlapped.

I've created a example that is using the same meta file and code as in TPrintPreview. This makes it easier to debug...
(i'm using the latest 2010-07-19 code from the source control)

The example can be downloaded from:
http://www.pecsforall.com/downloads/TestSynPDF.zip

If you need more information please let me know.

Martijn van der Kooij

Board footer

Powered by FluxBB