The ImportEMFFromFile function is designed specifically for importing EMF and WMF file formats. Delphi sample code provided below demonstrates how to use this function.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
procedure TForm2.btnImportEMFFromFileClick(Sender: TObject);
var
FileName: string;
ImageID: Integer;
ImWidth: Integer;
ImHeight: Integer;
begin
    PDFLibrary := TDebenuPDFLibrary1113.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;

It is also possible to convert EMF to PDF using the AddImageFromFile function, sample code for doing this can be found in this knowledge base article: Convert an image to PDF programmatically.