You are not logged in.
Pages: 1
My application generate EMF images and I render them into PDF using RenderMetaFile function.
Sometimes, not every, the resulting pdfs have render problems, normally when they contains images/logos.
Below 2 PDFs with the problem. They only work inside Chrome. Using another reader like Acrobat Reader they dont present errors.
https://dl.dropboxusercontent.com/u/697 … %20151.pdf
This is the EMF source:
https://dl.dropboxusercontent.com/u/697 … 0147-2.emf
I tried EMFExplorer, but I have no idea how to use it and what I need to search for.
Offline
I guess this is the forum thread for http://synopse.info/fossil/info/c20cbac8d43
Try to find out, using EmfExplorer, which EMF_* commands may be faulty.
Once you identified which part of SynPdf needs improvement, we may start looking into it.
How does your application generate the EMF?
Is it a known reporting tool/component?
If there is no image/logo, does it work as expected?
Which version of SynPDF are you using? Current from our source code repository is 1.18.2273.
Offline
Try to find out, using EmfExplorer, which EMF_* commands may be faulty.
Once you identified which part of SynPdf needs improvement, we may start looking into it.
I don't known how to do that, this is because that I'm here!
How does your application generate the EMF?
Is it a known reporting tool/component?
It is generated using delphi native api (TMetafileCanvas, textOut, Draw, etc...)
If there is no image/logo, does it work as expected?
Yes, it works!
Which version of SynPDF are you using? Current from our source code repository is 1.18.2273.
I'm using version 1.18.1417.
Last edited by betoneto.tbo (2016-01-20 17:54:53)
Offline
I upgraded to the latest version.
But I made some extra changes. I realy think that the faulty is about the image drawing (StretchDraw and different types of image).
I was drawing using the canvas Draw(X,Y,Graphic) and StretchDraw(Rect,Graphic), the images were bitmaps, jpgs, pngs.
Now I changed it to always generate a bitmap with the expected result size and without transparency. Then I draw it (using Draw(X,Y,Bitmap)) to the MetafileCanvas. So now I have only bitmaps in the metafile, so as in the resulting PDF.
I'll let this changes in test in some of my customers, because I wasn't able to reproduce the problem. I'll update this thread with the results in some days.
Last edited by betoneto.tbo (2016-01-20 17:59:03)
Offline
StretchDraw() should not be faulty IMHO, since it is handled by the library.
AFAIK jpeg or png, added via Draw/StrechDraw, would always be stored as bitmap to the MetaFileCanvas.
Transparency is not handled at library level, so it should not be the problem.
We are waiting for your feedback.
Offline
ab, problem solved!
I think the problem was around EMR_STRETCHBLT.
Below the complete solution that worked for me:
I upgraded to the latest version.
But I made some extra changes. I realy think that the faulty is about the image drawing (StretchDraw and different types of image).
I was drawing using the canvas Draw(X,Y,Graphic) and StretchDraw(Rect,Graphic), the images were bitmaps, jpgs, pngs.
Now I changed it to always generate a bitmap with the expected result size and without transparency. Then I draw it (using Draw(X,Y,Bitmap)) to the MetafileCanvas. So now I have only bitmaps in the metafile, so as in the resulting PDF.
I'll let this changes in test in some of my customers, because I wasn't able to reproduce the problem. I'll update this thread with the results in some days.
Offline
Hi!
I finally found the real BUG.
The problem occurrs when I use this windows API functions over the MetafileCanvas.
CreateRectRgnIndirect
SelectClipRgn
I create my MetafileCanvas setting a custom clip region to draw my stuff, and when I draw some images over the MetafileCanvas the PDF cannot render it correctly.
Here is the sample that reproduces the problem.
https://www.dropbox.com/s/ikoi2dv1wgzbf … g.zip?dl=0
To fix, I just removed my clip region!
Offline
Pages: 1