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!
22 emf files to a new pdf |
Post Reply |
Author | |
kalypso1977
Beginner Joined: 06 Jun 10 Status: Offline Points: 5 |
Post Options
Thanks(0)
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
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store