#1 2014-05-29 13:23:23

yagui
Member
Registered: 2014-05-29
Posts: 3

Clipping problem converting EMF to PDF

Hi,
I'm using this great library but I'm having problems in the resulting PDF with the bottom margin. I'm creating EMF files and then converting them to PDF but the bottom margin is written with text.

I send the EMF file and the resulting PDF so you can realize what the problem is.


http://sharesend.com/deq2m8s3 - EMF file
http://sharesend.com/of8p6zix - Converted PDF


This is the delphi code that I'm using to convert the Metafile to PDF:

         vpdf := TPdfDocumentGDI.Create;
         vpdf.GeneratePDF15File:=true;
         vpdf.CompressionMethod := cmNone;
         vPdf.DefaultPaperSize := psA4; // setup for standard 8.5x11 Letter
         vPdf.DefaultPageWidth := MulDiv(a.Width, 72, vPdf.ScreenLogPixels);
         vPdf.DefaultPageHeight := MulDiv(a.Height, 72, vPdf.ScreenLogPixels);
         vPdf.AddPage;
         vPdf.Canvas.RenderMetaFile(a, 1, 0, 0, tpExactTextCharacterPositining);
         vpdf.SaveToFile('c:\' + IntToStr(LI) + '.pdf');
         vpdf.free;

I really appreciate any help on this matter.

Thanks and regards,
Martin

Offline

#2 2014-05-29 13:36:02

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

Re: Clipping problem converting EMF to PDF

Did you try the latest 1.18 unstable version of SynPdf.pas from our source code repository?

AFAIR text clipping has been fixed some weeks ago, with a contribution by Pierre Le Riche...

Offline

#3 2014-05-29 14:03:16

yagui
Member
Registered: 2014-05-29
Posts: 3

Re: Clipping problem converting EMF to PDF

Unfortunately I'm getting exactly the same result.

I took the  nightly build  mORMotNightlyBuild.zip and I replaced the files mORMotReport.pas, SynCommons.pas, SynCrypto.pas, SynGdiPlus.pas, SynLZ.pas, SynPdf.pas of that build with the ones that I have in my project and I get the same PDF with the same problem.

What do you get I you try to convert the EMF that I attached to PDF?. Do you get the same result as me?

Thanks a lot for all your help.

Regards,
Martin

Offline

#4 2014-05-30 11:13:28

yagui
Member
Registered: 2014-05-29
Posts: 3

Re: Clipping problem converting EMF to PDF

AB,
  do yo have the chance to check if the EMF at http://sharesend.com/deq2m8s3 is well converted to PDF?. I would like to discard that the problem is mine.

Thanks and regards,
Martin

Last edited by yagui (2014-05-30 11:16:34)

Offline

Board footer

Powered by FluxBB