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;