#1 Yesterday 07:25:33

sameerpandit
Member
Registered: 2018-06-19
Posts: 7

Need help/direction for WMF file.

Hello,

I have wmf files like the one below :

Sample of WMF file

I am unable to Render/Draw the above wmf accurately in the PdfDocument.

If i tinker with the ScaleX,ScaleY parameters for RenderMetaFile method i am able to get results. However the accuracy isnt 100%.

On the other hand if i try using the VclCanvas.Draw method then images at bottom of page are missing in the Pdf.

Any sort of guidance will be appreciated.

-Sam

PS : I am not using any code worth mentioning. Simply like below :

Sample of code used

PPS : Edited the URLs. Thanks for pointing out RVK.

Last edited by sameerpandit (Yesterday 08:06:34)

Offline

#2 Yesterday 07:42:30

rvk
Member
Registered: 2022-04-14
Posts: 127

Re: Need help/direction for WMF file.

You might want to fix your links.
They give "Incomplete or wrong Download URL."

Offline

#3 Yesterday 15:54:54

rvk
Member
Registered: 2022-04-14
Posts: 127

Re: Need help/direction for WMF file.

Links are correct now (I guess it was the extra slash at the end).

The GDI+ implementation of SynPDF is far from perfect. It probably lacks some features used which results in a 'corrupt' PDF.

I did notice you used SynPDF. I don't have that installed anymore and the old SynPDF isn't updated anymore. For a more recent version you would need to use mormot.ui.pdf in mORMot2.

With that one I got a 'corrupt' pdf trying to do RenderMetaFile(pdf.Canvas, aMeta, 0.58, 1.30, 0, 0);

When I did pdf.VCLCanvas.Draw(0, 0, aMeta); I did get all the images. But the text wasn't exactly correct.

LmYClIY.png

But I can't speak for the older SynPDF.

Offline

Board footer

Powered by FluxBB