Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - 22 emf files to a new pdf
  FAQ FAQ  Forum Search   Register Register  Login Login

22 emf files to a new pdf

 Post Reply Post Reply
Author
Message
kalypso1977 View Drop Down
Beginner
Beginner


Joined: 06 Jun 10
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote kalypso1977 Quote  Post ReplyReply Direct Link To This Post Topic: 22 emf files to a new pdf
    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
 
 
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store