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 - Problem with Adding Image To Page - invisible
  FAQ FAQ  Forum Search   Register Register  Login Login

Problem with Adding Image To Page - invisible

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


Joined: 08 Nov 12
Location: Australia
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote andyhill Quote  Post ReplyReply Direct Link To This Post Topic: Problem with Adding Image To Page - invisible
    Posted: 14 Nov 12 at 8:27PM
I seem to be missing something ? Please advise - Thanks in advance.

          PDFLibrary.InsertPages(PageNo, 1);
          Inc(PageNo);
          ms.SetSize(0);
          ImageEn1.IO.SaveToStreamJpeg(ms);
          ImageID:= PDFLibrary.AddImageFromStream(ms, 0);
          lWidth:= PDFLibrary.ImageWidth;
          lHeight:= PDFLibrary.ImageHeight;
          PDFLibrary.DrawImage(0, 0, lWidth, lHeight);
          PDFLibrary.ReleaseImage(ImageID);


Back to Top
andyhill View Drop Down
Beginner
Beginner


Joined: 08 Nov 12
Location: Australia
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote andyhill Quote  Post ReplyReply Direct Link To This Post Posted: 14 Nov 12 at 8:51PM
Resolved

      PDFLibrary.InsertPages(PageNo, 1);
      PDFLibrary.SetPageDimensions(992, 1402); // A4
      Inc(PageNo);
      ms.SetSize(0);
      ImageEn1.IO.SaveToStreamJpeg(ms);
      ImageID:= PDFLibrary.AddImageFromStream(ms, 0);
      PDFLibrary.SelectImage(ImageID);
      lWidth:= PDFLibrary.ImageWidth;
      lHeight:= PDFLibrary.ImageHeight;
      PDFLibrary.SetOrigin(1);
      PDFLibrary.DrawImage(0, 0, lWidth, lHeight);
      PDFLibrary.ReleaseImage(ImageID);

Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 15 Nov 12 at 10:23AM

Andy,

Note : ImageWidth and ImageHeight return the image size in pixels and the DrawImage function requires measurements in points.

You can refer to this post for a method of importing an image based on the DPI of the image -  

http://www.quickpdf.org/forum/creating-a-multi-page-pdf-from-a-multipage-tiff_topic2125.html

Also 72points = 1 inch.  So  PDFLibrary.SetPageDimensions(842, 595);  will set the page to A4 or PDFLibrary.SetPageSize('A4');  will also work.

Andrew.
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