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!
Problems adding images to a PDF |
Post Reply |
Author | |
penrose
Beginner Joined: 29 Oct 19 Location: Daejon Status: Offline Points: 6 |
Post Options
Thanks(0)
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!
|
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(1)
|
I would suggest trying to call NormalizePage after you have selected the page and before you draw on it.
|
|
penrose
Beginner Joined: 29 Oct 19 Location: Daejon Status: Offline Points: 6 |
Post Options
Thanks(0)
|
It WORKS! Thank you!!!
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
...and i think a CombineContentStreams should help,too ;-)
Cheers and welcome here, Ingo |
|
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