You are not logged in.
Pages: 1
Hello,
I used synopse for creating pdf from QuickReport metafile with included EMF image by following code:
oPdf := TPdfDocumentGDI.Create;
...
aMeta := QRPrinter.PageList.GetPage(i);
oPdf.AddPage;
oPdf.VCLCanvas.Draw(0, 0, aMeta);
...
oPdf.SaveToFile(PdfSoubor);
oPdf.free;
There is a problem that the included EMF image gets wrong in the final pdf file.
Source EMF file: http://www.hjsoft.cz/temp/Tisk1.emf
Result PDF file: http://www.hjsoft.cz/temp/Tisk1.pdf
Do you have any idea what is wrong?
Thanks.
Best Regards.
Martin Roller
Last edited by martin.roller (2013-09-03 14:00:05)
Offline
If you use tpExactTextCharacterPositining option, it will render as expected.
procedure ConvertImage2Pdf(gr: TGraphic; const FileName: String);
var
PDF: TPDFDocument;
AMeta: TMetafile;
begin
PDF := TPdfDocument.Create;
try
AMeta := gr as TMetafile;
Pdf.AddPage;
Pdf.Canvas.RenderMetaFile(aMeta, 1, 0, 0, tpExactTextCharacterPositining);
Pdf.SaveToFile(FileName);
finally
Pdf.free;
end;
ShellExecute(Application.MainForm.Handle,'open',Pointer(FileName),
nil,nil,SW_NORMAL);
end;
Offline
Pages: 1