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 - Wrong image positioning?
  FAQ FAQ  Forum Search   Register Register  Login Login

Wrong image positioning?

 Post Reply Post Reply
Author
Message
OloLiuqui View Drop Down
Beginner
Beginner


Joined: 24 Mar 16
Location: Russia
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote OloLiuqui Quote  Post ReplyReply Direct Link To This Post Topic: Wrong image positioning?
    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.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 24 Mar 16 at 3:31PM
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

Back to Top
OloLiuqui View Drop Down
Beginner
Beginner


Joined: 24 Mar 16
Location: Russia
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote OloLiuqui Quote  Post ReplyReply Direct Link To This Post Posted: 24 Mar 16 at 5:54PM
Hi Ingo,

Normalization worked like a charm! Thanks a lot.

Best regards,
Olo
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