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 - Scanning
  FAQ FAQ  Forum Search   Register Register  Login Login

Scanning

 Post Reply Post Reply
Author
Message
bb46970 View Drop Down
Team Player
Team Player


Joined: 06 Mar 06
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote bb46970 Quote  Post ReplyReply Direct Link To This Post Topic: Scanning
    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.

Thanks
David
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: 12 Feb 07 at 1:51AM
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

Back to Top
bb46970 View Drop Down
Team Player
Team Player


Joined: 06 Mar 06
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote bb46970 Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 07 at 2:12AM
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.

 
Back to Top
ukobsa View Drop Down
Senior Member
Senior Member


Joined: 29 May 06
Location: Germany
Status: Offline
Points: 115
Post Options Post Options   Thanks (0) Thanks(0)   Quote ukobsa Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 07 at 3:12AM
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
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