#1 2012-07-30 12:40:20

BEKU123
Member
Registered: 2012-07-30
Posts: 7

PDF from MetaFile problem.

Hi, I'm tring to make pdf from metafile and I have a problem.

Those are my code: 

if lSaveDialog.Execute then
begin
      lFileName := lSaveDialog.FileName;
      pdf := TPdfDocumentGDI.Create(True, SynPdf.LCIDToCodePage(SysLocale.DefaultLCID), False);
      try

        pdf.EmbeddedTTF := True;
        pdf.EmbeddedWholeTTF := True;
        pdf.CompressionMethod := cmFlateDecode;
        pdf.ForceJPEGCompression:=20;
        pdf.DefaultPaperSize := psA4;
        pdf.UseSetTextJustification := False;
        pdf.StandardFontsReplace:= False;
        pdf.UseUniscribe := True;
       
        Page := Pdf.AddPage;

        pdf.VCLCanvas.StretchDraw(Rect(20, 20, Page.PageWidth+200, Page.PageHeight+190), FPage);

where FPage is my MetaFile.


When a save this pdf it's with strange font format. Where can I put example metafile and pdf ?
the metafile is normal...

Last edited by BEKU123 (2012-07-30 12:40:51)

Offline

#2 2012-07-30 12:47:38

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

Re: PDF from MetaFile problem.

It will depends on your metafile content.
How is it created?
Could you describe "strange font format" a little more explicitly?

Offline

#3 2012-07-30 12:52:45

BEKU123
Member
Registered: 2012-07-30
Posts: 7

Re: PDF from MetaFile problem.

it's created for TPrinter's canvas but in em explorer look's normal.
I have line with '|' marks and some text and again '|'. it's supose to do somthing like table.
I can send a metafile if You want. Problem is that lines are in diferent places so page is not like table. (in preview and in emfexplorer is).
Probably problem is laying in font embadding because in pdf there are different fonts that in metafile.

Sorry for my english.

Offline

#4 2012-07-31 06:17:58

BEKU123
Member
Registered: 2012-07-30
Posts: 7

Re: PDF from MetaFile problem.

When I Use TGDIPages the problem is the same. In preview windows it look fine but when I export it to PDF it isn't.

Offline

#5 2012-08-01 05:32:35

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

Re: PDF from MetaFile problem.

Did you use the latest version from http://synopse.info/fossil ?

Did you enable Font-Fallback, as stated by http://blog.synopse.info/post/2012/07/1 … generation ?
Did you try disabling it?

Is there any non English characters within the text?

Offline

#6 2012-08-01 13:06:22

BEKU123
Member
Registered: 2012-07-30
Posts: 7

Re: PDF from MetaFile problem.

Te Font-Fallback property (UseFontFallBack) gives no result enabled or disabled. Nothing's change. In Pdf seems like font's are bigger than in preview and other (i assume it's arial).
i have "courier new ce" in my metafile. That font is not embadded in pdf.

Yes I use non English characters but problem is not in them. Those are exported properly.

Offline

#7 2012-08-02 11:58:43

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

Re: PDF from MetaFile problem.

Are all characters defined in "courier new ce" font?
I guess the font fallback is not working in your configuration.
Do you have an "Arial Unicode MS" font installed?

Offline

#8 2012-08-03 09:44:59

BEKU123
Member
Registered: 2012-07-30
Posts: 7

Re: PDF from MetaFile problem.

I have "Arial Unicode MS" installed and all characters are in "Courier New Ce"... Can I Send You a MetaFile ?

Offline

#9 2012-08-03 10:06:57

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

Re: PDF from MetaFile problem.

Yes at webcontact01 at synopse dot info

Offline

#10 2012-08-03 10:17:56

BEKU123
Member
Registered: 2012-07-30
Posts: 7

Re: PDF from MetaFile problem.

I've send You an Email with Metafile... I'll be gratefull for Your help.

Offline

#11 2012-08-03 15:32:28

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

Re: PDF from MetaFile problem.

I've probably found the issue.

In fact, when a font is not available in the system as true type, there was a font-fallback to Arial.

Should be fixed by http://synopse.info/fossil/info/539c340a81
- now handle raster/device or bitmap fonts as the most close true-type font available
- speed-up of internal true-type fonts list (using binary search)

Hope it helped.

Offline

#12 2012-08-06 11:24:20

BEKU123
Member
Registered: 2012-07-30
Posts: 7

Re: PDF from MetaFile problem.

It's working fine. Thank's ! smile

Offline

Board footer

Powered by FluxBB