#1 Re: PDF Engine » Wrong rendering of TeeChart Metafile » 2016-01-31 06:33:44

So, it means that TeeChart exports to EMF file with wrong format when GDI+ and 3D enabled in the settings?

#2 Re: PDF Engine » Wrong rendering of TeeChart Metafile » 2016-01-27 06:20:06

I have tried to export with different settings and it worked!
Finally, I found the settings of TeeChart when the problem starts:
1. GDI+ shall be selected as a Render
2. 3D mode shall be enabled
3. Any series have to be on the chart.

When I changed the render to GDI or disable 3D mode, library works just fine.
Emf files are below:
1. GDI and 3D
3d_gdi.emf
2. GDI+ and 3D
3d_gdi+.emf

#3 Re: PDF Engine » Wrong rendering of TeeChart Metafile » 2016-01-26 14:53:20

I downloaded the latest mORMot, but still the issue remains.

#4 Re: PDF Engine » Wrong rendering of TeeChart Metafile » 2016-01-26 14:31:33

I've downloaded it from GitHub, version is 1.18, but there is not build number mentioined.

#5 PDF Engine » Wrong rendering of TeeChart Metafile » 2016-01-26 14:24:06

chachora
Replies: 9

Metafile generated by TeeChart is not rendered correctly.
When I render it with bitmap, I get the following image:
bmp.png
But in pdf it is completely wrong:
pdf.png

This is my code:

var
  PdfDoc: TPdfDocumentGDI;
  PdfPage: TPdfPage;
  ChartMetafile: TMetafile;
  bmp: TBitmap;
begin
  ChartMetafile := nil;
  bmp := nil;
  PdfDoc := TPdfDocumentGDI.Create(False, 0, true, nil);
  try
    PdfPage := PdfDoc.AddPage;
    PdfPage.PageLandscape := true;

    ChartMetafile := Chart.TeeCreateMetafile(False, Rect(0,0, PdfPage.PageWidth, PdfPage.PageHeight));

    bmp := TBitmap.Create;
    bmp.Width := ChartMetafile.Width;
    bmp.Height := ChartMetafile.Height;
    bmp.Canvas.Draw(0, 0, ChartMetafile);
    bmp.SaveToFile('c:\temp\test.bmp');

    PdfDoc.VCLCanvas.Draw(0, 0, ChartMetafile);
    PdfDoc.SaveToFile('c:\temp\test.pdf');

  finally
    PdfDoc.Free;
    ChartMetafile.Free;
  end;

I tried it with RenderMetafile also, it gave the same result. What can be the problem?

Board footer

Powered by FluxBB