Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

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;

© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum