On converting xls to pdf, vector images become pixelized

Hi, I use TMS FlexCel for VCL with Delphi XE5. For creating user-defined PDF reports with analysis results and plots, I provide a xls file with tagged cells. On report creation, the tagged cells get then filled by the software with content (text, numbers and plots). The plots are inserted as wmf images.
Everything looks fine in the generated xls file. However, in the final PDF, the plots are all pixelized. When I directly save the xls file as PDF from Excel, the plots are still vectorized and look good at all sizes.
Below is some pseudo-code, that shows the general process. I s there some setting to control this behaviour and have vectorized plots in the final PDF document?

var
  MyChart : TChart    // a Steema VCL TeeChart 
  xls: TXlsFile;
  Report: TFlexCelReport;
  pdf: TFlexCelPdfExport;
  PdfStream: TFileStream;
  Bytestream : TBytesStream;

begin  
    xls := TXlsFile.Create(true);
    Report := TFlexCelReport.Create(true);
	
	xls.Open('MyTemplate.xlsx');	
	
	// configure report
	with Report do  
	begin
          SetValue('SampleName', Samplerun.Basename);
	  AddTable<TReportPeak>('Peak', GetReportPeakList);
	  With MyChart.TeeCreateMetafile(false,Rect) do
	  try
	    Bytestream:=TBytesStream.Create();
	    try
  		  SaveToStream(Bytestream);
		  SetValue('chrom_img', Bytestream.Bytes);
	    finally
		  Bytestream.Free;
	    end;
      finally
        Free;
      end;		
   end  
   
   Run(xls);                        //create Report
   xls.Save(xlsname);				//save xls report file
   
   //save PDF report file
   Pdf := TFlexCelPdfExport.Create(xls, true);
   try
     pdfname:=SampleRun.filepath+'MyReport.pdf'
	 PdfStream := TFileStream.Create(pdfname, fmCreate);
	 try
	   Pdf.BeginExport(PdfStream);
	   Pdf.PageLayout := TPageLayout.Outlines;
	   Pdf.ExportAllVisibleSheets(false, '');
	   Pdf.EndExport();
	 finally
	   PdfStream.Free;
	 end;
   finally
	 Pdf.Free;
   end;
end; 

Hi,
Windows metafiles (WMF) are sadly not supported in pdf (or anything that is not from Windows really), so FlexCel has to render them as a PNG before inserting them. While we could "convert" the metafile commands to pdf commands, (that's what Excel does), sadly this is outside our current scope (it would mean creating a wmf to pdf component)

The best 2 workarounds I can think are:

  1. While metafiles will be embedded as pngs, you can control the resolution of the png, so it doesn't look pixelated. Not 100% the same as a real vectorized image, but with a good resolution the charts will look good at any zoom.

You can change the resolution of rasterized images with:
https://doc.tmssoftware.com/flexcel/vcl/api/FlexCel.Core/TFlexCelConfig/DpiForImages.html
So for example

TFlexCelConfig.DpiForImages := 192;

will likely work.

  1. The other solution if possible is to use a real Excel chart, instead of a metafile. Excel charts will be exported vectorially to the pdf.

Thanks, increasing the dpi value works good enough. Except the much increased file size, but who cares about disk space consumption these days...