Do you own a Quick PDF Library 7 or iSEDQuickPDF license? Upgrade to Quick PDF Library 8 today!
![]() |
Insert and draw Image in New PDF |
Post Reply
|
| Author | |
Tim Hayes
Beginner
Joined: 16 Feb 07 Online Status: Offline Posts: 7 |
Post Options
Quote Reply
Topic: Insert and draw Image in New PDFPosted: 10 Mar 10 at 4:01PM |
|
Sorry this is a basic question...
I want to be able to draw an image (jpg) in a new PDF document.
OPDF := TiSEDQuickPDF.create;
OPDF.UnlockKey('...'); OPDF.Unencrypt;
OPDF.UseUnsafeLayers(1); OPDF.SelectDocument(OPDF.NewDocument); OPDF.AddJPEGImageFromFile('aaa.jpg'); OPDF.DrawImage(0,0,OPDF.ImageWidth,OPDF.ImageHeight); OPDF.SaveToFile('NewPDF.pdf'); The resultant PDF file contains just a blank page.
Could anyone please help??
Thanks.
|
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Online Status: Offline Posts: 1684 |
Post Options
Quote Reply
Posted: 10 Mar 10 at 4:48PM |
|
Hi Tim!
Try this one: // . . . QP := TQuickPDF.Create; try QP.UnlockKey('...'); image := QP.AddImageFromFile(fstring, 0); QP.SetOrigin(1); // :-)) QP.SelectImage(image); QP.SetPageDimensions(QP.ImageWidth,QP.ImageHeight); QP.DrawImage(0,0,QP.ImageWidth,QP.ImageHeight); QP.SaveToFile('c:\temp\test.pdf'); finally QP.Free; end; // . . . Cheers, Ingo Edited by Ingo - 10 Mar 10 at 5:08PM |
|
![]() |
|
DELBEKE
Quick PDF Library Expert
Joined: 31 Oct 05 Location: France Online Status: Offline Posts: 151 |
Post Options
Quote Reply
Posted: 10 Mar 10 at 4:59PM |
|
Before drawing, set origin at the top left corner
Qp.SetOrigin(1);
|
|
![]() |
|
Tim Hayes
Beginner
Joined: 16 Feb 07 Online Status: Offline Posts: 7 |
Post Options
Quote Reply
Posted: 10 Mar 10 at 6:14PM |
|
Both:
Needed Ingo's solution + Delbeke's SetOrigin(1).
Many thanks indeed for saving lots of hours.
|
|
![]() |
|
Post Reply
|
| 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 |