Print Page | Close Window

22 emf files to a new pdf

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1496
Printed Date: 18 May 24 at 1:55PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: 22 emf files to a new pdf
Posted By: kalypso1977
Subject: 22 emf files to a new pdf
Date Posted: 21 Jun 10 at 10:13AM
Hello!
 
How can I convert 22 emf files (every emf = one pdf page), to a pdf. Have checked out this delphi code, but I get a corrupt pdf file.
 
***********************************************************
procedure TForm1.Button1Click(Sender: TObject);
var
FileName: string;
ImageID: Integer;
ImWidth: Integer;
ImHeight: Integer;
PDFLibrary : TQuickPDF0719;
UnlockResult : Integer;
Filepath : string;
I : integer;
begin
PDFLibrary := TQuickPDF0719.Create;
  try
    UnlockResult := PDFLibrary.UnlockKey('*********');
    if UnlockResult = 1 then
    begin
      //Now we wil add 22 pages to the document for the 22 emf's
      PDFlibrary.InsertPages(0, 21);
      Filepath := 'Z:\test\';
      for I := 1 to 22 do begin
        if i < 10 then begin
          FileName := 'Z:\test\0005000'+IntToStr(i)+'.EMF';
        end
        else begin
          FileName := 'Z:\test\000500'+IntToStr(i)+'.EMF';
        end;
        PDFLibrary.SelectPage(i-1);
        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);
      end;
      PDFLibrary.SaveToFile('Z:\test\test.PDF')
    end;
  finally
    PDFLibrary.Free;
  end;

end;
************************************************************
Thanks for help!
 
kalypso
 
 



Replies:
Posted By: Ingo
Date Posted: 22 Jun 10 at 3:45PM
Hi!

Why not reading one emf after the other... converting it to pdf (and keep the pdf-name in mind)...
and in the end merge all documents together?

Cheers, Ingo




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk