Print Page | Close Window

5 ImageFiles to one 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=3404
Printed Date: 18 May 24 at 2:41PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: 5 ImageFiles to one PDF
Posted By: luet
Subject: 5 ImageFiles to one PDF
Date Posted: 06 Nov 16 at 10:37PM
Hi,

Is it possible to convert 5 image files (JPG) into a new PDF file (only one PDF)?
Thanks for help and a few lines of code

luet



Replies:
Posted By: Ingo
Date Posted: 06 Nov 16 at 10:40PM
Hi Luet,

i think you don't know that there are online resources with kb-articles, online reference and so on.
Simply go on the official support pages to check this out.
The developer guide you've got with installation, too.
QP offers functionalities to render each iamge into a pdf-page and putting these pdf-pages into one new pdf.



-------------
Cheers,
Ingo



Posted By: luet
Date Posted: 07 Nov 16 at 7:33AM
This is known to me.
But I would like to bring 5 pictures into a single PDF.
There is no article, example or hint.
Nowhere...

thanks Ingo


Posted By: luet
Date Posted: 07 Nov 16 at 9:27AM
Thanks Ingo, that you are there for this forum.
That's great.
But there are just too few examples in the Developer Guide, kb-articles and in the online reference.
This is a real shortcoming, so I ask here in the forum.

But I have now developed a solution and everything is going well now.
thank youSmile


Posted By: Ingo
Date Posted: 07 Nov 16 at 7:52PM
Hi Luet,

it's often like this.
People asking for help...
and if they are ready there isn't the time to post a sample into the samples section.
That's why there are less samples :(



-------------
Cheers,
Ingo



Posted By: Ingo
Date Posted: 07 Nov 16 at 8:02PM
I think you don't know how to search?

Take an empty pdf or create an initial one with an empty page and then use this sample:
http://www.debenu.com/kb/add-images-pdf-programmatically/
It won't feed your needs in detail but you can modificate it.

Here's an easy sample dealing with one image but you can put the code into a loop gathering more images:
http://www.debenu.com/kb/convert-an-image-to-a-pdf-programmatically/

Here's an aditional thread giving you an idea what's possible with QuickPDF:
http://www.quickpdf.org/forum/add-300dpi-image-to-pdf_topic2564.html

I've searched for these three ressources from here:
http://www.debenu.com/docs/pdf_library_reference/Search.php
...with the search string "image to pdf".



-------------
Cheers,
Ingo



Posted By: luet
Date Posted: 08 Nov 16 at 12:45PM
Hello,
But I know how I must look.
But you did not quite understand me.
The question was not how do I get from one picture to one PDF file.
But how do I get more than one picture (5 pictures) in a PDF file!
And there is still no example of this.
By trying, I managed to find the solution, which was very easy afterwards.
Here is my code:

For n = 1 to Filecount

         exten = LCase(Mid(Datei (n), InStrRev(Datei(n), ".")))
        If (GetAttrW(path& Datei(n)) And vbDirectory) = vbDirectory Then

         ElseIf InStr(".jpg.jpeg.jpe.jfif.gif.tif.tiff.png.wmf.bmp.emf", exten) > 0  Then
          Nummer = Nummer + 1

            If Nummer = 1 Then
            DocID1 = QPdf.NewDocument()
             End If

            QPdf.AddImageFromFile path & Datei(n), 0
            lWidth = QPdf.ImageWidth() * size
            lHeight = QPdf.ImageHeight() * size
            QPdf.SetPageDimensions lWidth, lHeight
            QPdf.DrawImage 0, lHeight, lWidth, lHeight '// Store the updated PDF where you like
      
            QPdf.NewPage
        End If
    Next
    QPdf.DeletePages QPdf.PageCount, 1

              lRet = QPdf.SaveToFile(NewFilename)
         



Posted By: Ingo
Date Posted: 08 Nov 16 at 9:34PM
I did understand you ...
I've written "...Here's an easy sample dealing with one image but you can put the code into a loop gathering more images:...".
And i see that you've done it with success ;-)

At a second step you can check if tiff-files have more than one image inside and render each of it on a separate pdf-page...



-------------
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