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!
![]() |
Scanning |
Post Reply ![]() |
Author | |
bb46970 ![]() Team Player ![]() Joined: 06 Mar 06 Status: Offline Points: 33 |
![]() ![]() ![]() ![]() ![]() Posted: 11 Feb 07 at 5:39PM |
Up until now, I just have been using QuickPDF for printing. Now, I want to scan documents and save them as PDFs. I am able to scan the documents as bitmaps, without a problem. To add the image, I have tried "QP.AddImageFromStream." I also tried saving the bitmap as a file and then call "QP.AddImageFromFile." The bitmap file is correct. To draw the image, I have tried both "QP.DrawScaledImage" and "QP.DrawImage." I have also varied the parameters, with each of the methods. The PDF file size indicates that the bitmap is saved to the PDF; however, the only part that is visible a black border at the bottom of the scanned page. I am able to add text, to the same PDF, with QP.DrawText, without a problem. ThanksDavid
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi!
I've no problems with these functions. Perhaps you should try SetOrigin and/or SetMeasurementUnits... Posting a code-snippet here could be helpful to help ;-) Best regards, Ingo |
|
![]() |
|
bb46970 ![]() Team Player ![]() Joined: 06 Mar 06 Status: Offline Points: 33 |
![]() ![]() ![]() ![]() ![]() |
I have a lot of commented-out code, because I was trying so many different things. Basically, I got down to this:
Image.SaveToFile('test.bmp');
iID := QP.AddImageFromFile('test.bmp', 0);
if iID <> 0 then
begin QP.SetTransparency(0); QP.SelectImage(iID);
QP.DrawText(100, 500, 'Page 1');
QP.NewPage();
QP.DrawScaledImage(0, 0, 1);
QP.SaveToFile('test.pdf');
end;
After you post, I added:
QP.SetOrigin(1);
which got the image to draw.
However, the sizing was off. I added:
QP.SetMeasurementUnits(2);
and changed DrawScaledImage to:
QP.DrawImage(0, 0, 8.5, 11);
It seems to work now.
Thanks.
|
|
![]() |
|
ukobsa ![]() Senior Member ![]() Joined: 29 May 06 Location: Germany Status: Offline Points: 115 |
![]() ![]() ![]() ![]() ![]() |
Hi,
just a small explanation: default setting for QuickPDF is to have it's origin on bottom-left. DrawImage uses as position the top-left corner of the image. So when you draw an image at position (0,0) it is drawn completely outside the page (exactly: below the page). SetOrigin(1) now sets QuickPDFs origin to top-left so that now drawing an image at (0,0) starts to draw it in the top-left corner of the page. HTH, Ulrich |
|
![]() |
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