Frequently Asked Question:
How do I use the ImportEMFFromFile function?
Question
How do I use the ImportEMFFromFile function? Any examples?
Answer
The ImportEMFFromFile function is designed specifically for importing EMF and WMF file formats. Delphi sample code provided below demonstrates how to use this function.
procedure TForm2.btnImportEMFFromFileClick(Sender: TObject);
var
FileName: string;
ImageID: Integer;
ImWidth: Integer;
ImHeight: Integer;
begin
PDFLibrary := TQuickPDF0718.Create;
try
UnlockResult := PDFLibrary.UnlockKey('INSERT LICENSE KEY');
if UnlockResult = 1 then
begin
FileName := 'C:\Sample.EMF'
ImageID := PDFLibrary.ImportEMFFromFile(FileName, 1, 0);
PDFLibrary.SelectImage(ImageID);
ImWidth := PDFLibrary.ImageWidth();
ImHeight := PDFLibrary.ImageHeight();
PDFLibrary.DrawImage(0, ImHeight, ImWidth, ImHeight);
PDFLibrary.SetPageDimensions(ImWidth, ImHeight);
PDFLibrary.SaveToFile('C:\Sample.PDF')
end;
finally
PDFLibrary.Free;
end;
end;