#1 2012-04-23 07:38:38

chuqingsheng
Member
Registered: 2012-04-23
Posts: 1

synPDF create PDF from Metafile problem

I have a report tool generate metafile . the metafile content some chinese word. Using canvas of paintbox draw this metafile, those words display are correct. but I using TpdfDocument.VCLCanvas draw this metafile .those words display is incorrect in the generated pdf file .

is synPDF bug??

my code snippet:

  pdf := TPdfDocumentGDI.Create(True, LCIDToCodePage(SysLocale.DefaultLCID), False);   // GB2312_CHARSET;
  pdf.EmbeddedTTF := True;
    Metafile := MakePageMetafile(i, Round(rve.PageProperty.PageWidth), Round(rve.PageProperty.PageHeight));
    try
      pdf.AddPage;
      pdf.VCLCanvas.Draw(0, 0, Metafile);
    finally
      Metafile.Free;
    end;
  pdf.SaveToFile('c:\testdirect.pdf');
  pdf.Free;

Offline

#2 2012-04-23 11:43:39

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

Re: synPDF create PDF from Metafile problem

As stated in this forum and the SynPDF unit documentation (i.e. interface comments), there is not "font fallback" mechanism implemented yet.
See http://msdn.microsoft.com/en-us/library … t_fallback

You'll have to explicitly set a font which contains all Chinese glyphs at metafile content creation.

Offline

Board footer

Powered by FluxBB