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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Problems adding images to a PDF
  FAQ FAQ  Forum Search   Register Register  Login Login

Problems adding images to a PDF

 Post Reply Post Reply
Author
Message
penrose View Drop Down
Beginner
Beginner
Avatar

Joined: 29 Oct 19
Location: Daejon
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote penrose Quote  Post ReplyReply Direct Link To This Post Topic: Problems adding images to a PDF
    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.SelectPage(1)

        QP.SetOrigin(1)
        QP.SelectImage(tempimage )
        
        QP.DrawImage(0, 0, 100, 100)
  
        QP.SaveToFile(OutputFile)
     
        QP.RemoveDocument(docID)


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.

http://oum.kr/source.pdf

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!
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 255
Post Options Post Options   Thanks (1) Thanks(1)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
penrose View Drop Down
Beginner
Beginner
Avatar

Joined: 29 Oct 19
Location: Daejon
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote penrose Quote  Post ReplyReply Direct Link To This Post Posted: 30 Oct 19 at 1:55AM
It WORKS! Thank you!!!
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3029
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 31 Oct 19 at 3:29PM
...and i think a CombineContentStreams should help,too ;-)

Cheers and welcome here,
Ingo

Cheers,
Ingo

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

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

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store