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!
![]() |
Delphi 2007 - Convert multipage TIFF file to PDF |
Post Reply ![]() |
Author | |
janigorse ![]() Beginner ![]() Joined: 14 Feb 13 Status: Offline Points: 1 |
![]() ![]() ![]() ![]() ![]() Posted: 14 Feb 13 at 1:57PM |
Code below converts my TIFF file to PDF. But when I open the PDF with Acrobat, scrolling to particular page (sometimes page 4, on the other file page 2 for example) shows an Error on page
message. Can you point me to direction where can I look for a solution? procedure TForm1.ConvertTiffToPdf(inputImagePath: String; outputFilePath: String); var page, pages, id, UnlockResult, result, dpix, dpiy, docid: Integer; imageWidthInPoints, imageHeightInPoints: Double; pdfLib: TDebenuPDFLibrary0913; begin pdfLib := TDebenuPDFLibrary0913.Create; pdfLib.UnlockKey('jn3343ac9ko4yt4gj7ak5z34y'); docid := pdfLib.NewDocument; pdfLib.SetPDFAMode(2); pages := pdfLib.GetImagePageCount(inputImagePath); if pages = 0 then pages := 1; for page := 1 to pages do begin if page <> 1 then pdfLib.NewPage; id := pdfLib.AddImageFromFile(inputImagePath, page); pdfLib.SelectImage(id); dpix := pdfLib.ImageHorizontalResolution; dpiy := pdfLib.ImageVerticalResolution; if dpix = 0 then dpix := 72; if dpiy = 0 then dpiy := 72; imageWidthInPoints := pdfLib.ImageWidth / dpix * 72.0; imageHeightInPoints := pdfLib.ImageHeight / dpiy * 72.0; pdfLib.SetPageDimensions(imageWidthInPoints, imageHeightInPoints); pdfLib.SetOrigin(1); pdfLib.DrawImage(0, 0, imageWidthInPoints, imageHeightInPoints); end; pdfLib.SaveToFile(outputFilePath); pdfLib.RemoveDocument(docid); pdfLib.Free; end; |
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
Is the TIFF file a colour LZW TIFF image ? Andrew.
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Andrew!
It's 9.13 ;-) 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