Print Page | Close Window

Insert More Images

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=1971
Printed Date: 22 Nov 24 at 11:15PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Insert More Images
Posted By: mabermeo
Subject: Insert More Images
Date Posted: 22 Sep 11 at 1:51AM
Hi!

i need Add more images .tif in only one file .pdf

'c:\001-EXP3.tif = multitif 13 images
Code:

    Call QP.AddImageFromFile("c:\001-EXP3.tif", 3)   '--> 3 = Pag. Num.
    lWidth = QP.ImageWidth()
    lHeight = QP.ImageHeight()
    Call QP.SetPageDimensions(lWidth, lHeight)
    Call QP.DrawImage(0, lHeight, lWidth, lHeight)

    If QP.SaveToFile("c:\from image.pdf") = 1 Then


in the file .PDF only add 1 image not 13


Regards!



Replies:
Posted By: Ingo
Date Posted: 22 Sep 11 at 8:27PM
Hi Maber!

You have to work with a loop...
...with the QuickPDF-syntax
"NewPage",
"GetImagePageCount",
...
then it will work.
Have a look at the online reference here:
http://www.quickpdflibrary.com/help/quickpdf/FunctionGroups.php

Cheers and welcome here,
Ingo



Posted By: AndrewC
Date Posted: 26 Sep 11 at 5:19AM
Also it is important to remember that ImageWidth and ImageHeight return the width and height of the image in pixels.  The SetPageDimensions expects measurements in points where 72points = 1 inch.  

You would need to use ImageHorizontalResolution, ImageVerticalResolution and ImageReolutionUnits to calculate the size of the original image.  Not all image fomats return a DPI value such as PNG files.

 for i = 1 to 13
 begin
    if (i <> 1) then
      QP.NewPage();  // Page 1 is created by default.

    QP.AddImageFromFile("c:\001-EXP3.tif", i)   '--> i = Pag. Num. 
    lWidth = QP.ImageWidth() * 72.0 / QP.ImageHorizontalResolution();
    lHeight = QP.ImageHeight() * 72.2 / QP.ImageVerticalResolution(); 
    QP.SetPageDimensions(lWidth, lHeight) 
    QP.DrawImage(0, lHeight, lWidth, lHeight) 
 end;

 If QP.SaveToFile("c:\from image.pdf") = 1 Then 




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