Print Page | Close Window

Problems adding images to a 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
Printed Date: 05 Aug 21 at 10:10AM
Software Version: Web Wiz Forums 11.01 -

Topic: Problems adding images to a PDF
Posted By: penrose
Subject: Problems adding images to a PDF
Date Posted: 29 Oct 19 at 2:37PM
I bought this library a few days ago.
I'm new to using this library.

I am using the function to add a image file to a PDF file.

The source code is as follows:

        Dim fileName As String = "c:\source.pdf"
        Dim OutputFile As String = "c:\qpdf.pdf"

        Dim docID As Integer = QP.LoadFromFile(fileName, "")
        Dim tempimage As Integer 
        tempimage = QP.AddImageFromFile("c:\x.jpg", 0)


        QP.SelectImage(tempimage )
        QP.DrawImage(0, 0, 100, 100)

No problem with pdf files created with adobe acrobat.

However, using Microsoft's print to pdf feature, the position and shape of the image may not be accurate.

The image is reversed and added to the wrong place

You can download a pdf file that doesn't work with the code above.

I would like to know how to add an image without converting this pdf file to pdf using acrobat again.

I love this library, thank you!

Posted By: tfrost
Date Posted: 29 Oct 19 at 5:45PM
I would suggest trying to call NormalizePage after you have selected the page and before you draw on it.

Posted By: penrose
Date Posted: 30 Oct 19 at 1:55AM
It WORKS! Thank you!!!

Posted By: Ingo
Date Posted: 31 Oct 19 at 3:29PM
...and i think a CombineContentStreams should help,too ;-)

Cheers and welcome here,


Print Page | Close Window

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