#1 Re: PDF Engine » SynPdf library 1.18 » 2012-12-03 20:14:07

I am sorry, I feel not competent enough to understand your source. Basically I am not an expert of such deep-in-the-system things, that's why I am using 3rd party libs for such functionality. Instead, I am writing end-user software...
I will try other ways of drawing if I will see the clipping somehow.
Anyway, I had already stated elsewhere that this free SynPDF is much better than other expensive libs...

#2 Re: PDF Engine » SynPdf library 1.18 » 2012-12-03 18:10:13


clipping does still NOT work! I was hoping for this enhancement since you promised that some months ago. But it does not work when drawing on the TCanvas.

#3 Re: PDF Engine » Rendering meta file does not work » 2012-10-19 18:32:37

Hopefully within the next 3-4 weeks!

To summarize for all who read this and are still researching for a PDF lib:
I tested so many expensive libs and they all had too much overhead/functions which I don't need and which I don't want to pay for. With Synopse open source I had the source code and could learn its workings much quicker than without source of the trial versions.
And now one absolutely primary criterium. Synopse creates by far the smallest PDF file sizes of all what I had tested. F.ex. a normal report is 200KB while with others the same report gets up to 56MB!

Great work! Keep on working... :-)

#4 Re: PDF Engine » Rendering meta file does not work » 2012-10-19 15:58:35

Just to inform you.
Finally I found by the right equivalent settings that there is no difference in output quality between drawing directly on the VCLCanvas and drawing on TMetaFileCanvas. So I have continued with using VCLCanvas. The wrong coordinates (because it is not MM-LoMetric capable) were not a big problem since I can translate the mm-coordinates to pixel once I found the right scaling factor.

Right now I have one issue remaining. Drawing text using ETO_Clipped does not work on the VCLCanvas. F.ex. I am writing
ExtTextOut(ADC, X, Y, ETO_Clipped, @ARect, PChar(AText), -1, nil);
This must clip the text at the right side if it does not fit into the ARect. But it does not with VCLCanvas. I need this urgently because in my reports the values must strictly follow the columns and they must not overwrite neighboured columns. Any idea? Is there any setting in TPdfDocumentGDI which enables this?


#5 Re: PDF Engine » Rendering meta file does not work » 2012-10-18 13:54:20

ab wrote:

1. and 2. may need huge code refactoring to had such metrics, which are not handled yet by the conversion engine.

So you are saying: SynPDF cann not render meta files which had been created using MM_LoMetric? Please confirm explicitly.

ab wrote:

3. There is already something in the forum about this point.
AFAIR: change the dpi before adding a page.

I know that. This does not change the strange results. F.ex. horizontal scalings do not match the vertical scalings, only with 96dpi this is correct.

You did not answer my last question:
Do I have any benefit at all when using a higher resolution for the meta canvas?

Best regards

#6 PDF Engine » Rendering meta file does not work » 2012-10-18 12:35:44

Replies: 7

I have been trying (and erroring...) a while with the SynPDF and it looks if indeed the mostly proposed way of creating a meta file and then rendering it into PDF gives the best results.
However, I am experiencing several problems.

I have created the meta file using SetMapMode(MM_LoMetric) and writing directly to the Canvas. This is necessary since so I can use all my code written for the normal printer canvas.
I am rendering like this: PdfPrinter.Canvas.RenderMetaFile(MetaFile,1,0,0,false,99,99);

1. Rendering with wrong coordinates
The EMF file looks good but in the PDF output the lines are written from bottom up. I assume this has to do with the MM_LoMetric? When trying to write directly on VCLCanvas before, I read that there the coordinates do not follow the normal TCanvas standard. What do I have to set/initialize to get the right Y-axis direction?

2. Wrong place and scaling
The output is placed somewhere on the PDF page. It is out of the destination format A4. Actually I had increased the PDFPage.PageHeight until I could see the output. This is only for y-axis, X-positions are correct. Even if the lines are in the wrong order, then the last one (of a full page) should appear at the top of the page.
Obviously a scaling factor of 1 is wrong and gives too small output. But I tried something like DestinationWidth/SourceWidth, without success.
Any hints?

3. Resolution of the metafile
Using 96 DPI (Screen) looks perfect. But shouldn't a value of 300 (like printer canvas) also work? It does not, it gives me stange results. It looks like the scaling factors of a screen canvas are different to a printer canvas. Do I have any benefit at all when using a higher resolution for the meta canvas?

I can send you my EMF and PDF file by email if you need that.

Thanks in advance!

Board footer

Powered by FluxBB