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!
Wrong image positioning? |
Post Reply |
Author | |
OloLiuqui
Beginner Joined: 24 Mar 16 Location: Russia Status: Offline Points: 6 |
Post Options
Thanks(0)
Posted: 24 Mar 16 at 2:50PM |
Hi I'm using Debenu Quick PDF Library 11.14. I have a Delphi code that injects a raster image to PDF page. It works as expected on most PDFs, but one PDF causes an issue. Here is the code: --- PDF := CoPDFLibrary.Create; PDF.LoadFromFile('d:\TestDocs\EasyRecovery622 User Guide_EN.pdf', ''); PDF.SelectPage(1); Height := PDF.PageHeight; Width := PDF.PageWidth; PDF.AddImageFromFile('d:\TestDocs\test.png', 0); ImgHeight := PDF.ImageHeight; ImgWidth := PDF.ImageWidth; PDF.DrawImage(10, Height - 10, ImgWidth, ImgHeight); PDF.SaveToFile('d:\TestDocs\embedded.pdf'); --- I expect that the image will be embedded at the left top corner of the page and will be fully visible. With the attached PDF I can see only a small part of the image after saving the target 'embedded.pdf' doc. Is it a bug of the library or something is wrong with my source 'EasyRecovery622 User Guide_EN.pdf' doc? Here is the problem PDF and sample PNG image: https://drive.google.com/file/d/0B0r9WqjL12gOZzJYRTdHeDJmSDQ/view?usp=sharing Thank you in advance.
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Olo,
if you wanna tell QuickPDF where to draw an image you should tell where the starting point should be. With SetOrigin you can do this: http://www.debenu.com/docs/pdf_library_reference/SetOrigin.php An additional thing you should have an eye on is that sometimes pdf-pages are made in portrait mode and later rotated to landscape. So a NormalizePage first should be always good: http://www.debenu.com/docs/pdf_library_reference/NormalizePage.php Cheers and welcome here, Ingo |
|
Cheers,
Ingo |
|
OloLiuqui
Beginner Joined: 24 Mar 16 Location: Russia Status: Offline Points: 6 |
Post Options
Thanks(0)
|
Hi Ingo,
Normalization worked like a charm! Thanks a lot. Best regards, Olo
|
|
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