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!
![]() |
RenderpagetoDC example needed |
Post Reply ![]() |
Author | |
rogerad ![]() Beginner ![]() Joined: 08 Dec 05 Location: Australia Status: Offline Points: 14 |
![]() ![]() ![]() ![]() ![]() Posted: 19 Mar 09 at 6:43AM |
could someone please show an example using renderpagetodc
i am using a tpanel and DELPHI 6 when i assigned the handle to tpanel nothing appeared here was my code hand := panel1.handle; qpbook.RenderPagetodc(1,1,hand ); i am trying to see the 1st page of the pdf |
|
roger adams
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Roger!
This is the function: RenderPageToDC(DPI, Page, DC: Integer) I don't know anything about this function (it's a new one) but if you're using value "1" for dpi this should be too less ;-) As dpi you should try 72, 150 or up to 300. Cheers, Ingo |
|
![]() |
|
Rowan ![]() Moderator Group ![]() ![]() Joined: 10 Jan 09 Status: Offline Points: 398 |
![]() ![]() ![]() ![]() ![]() |
Hi Roger,
You are using a TPanel.Handle property, which is a HWND handle, but a HDC handle is required instead. You should try using something like TBitmap.Canvas.Handle or TPaintBox.Canvas.Handle. I hope this helps. Cheers, Rowan |
|
![]() |
|
RhoTu ![]() Beginner ![]() Joined: 29 Jun 09 Location: Minnesota Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() |
I would like to do the opposite. I have a Delphi app that has drawn on an image and I would like that to be rendered/copied to a QP document. Any examples as to proc/func calls?
TIA
RT
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Rho!
If you want to do it the other way round you should do a new post 'cause in this case now nobody will find this answer here if he's searching for the same and see the original headline but anyway...
BTW: In the sample section here there are samples for what you need!
Here's a code snippet for you:
QP := TDQuickPDF.Create;
try QP.UnlockKey('MyKey'); QP.LoadFromFile(Edit1.Text); If ( QP.Encrypted > 0 ) Then QP.Unencrypt; QP.CombineLayers; // 0 = BMP / 1 = jpg / 3 = EMF / 4 = EPS Test_Stream := Tmemorystream.Create; QP.RenderPageToStream(72,1,1,test_stream,1,0); finally QP.Free; end; test_stream.Seek(0,0);
jpg := TJpegImage.create; jpg.LoadFromStream (test_stream); Form1.Image1.Picture.Assign(jpg);
Form1.Show;
test_stream.Clear; jpg.Destroy; Cheers, Ingo Edited by Ingo - 30 Jun 09 at 6:48AM |
|
![]() |
|
RhoTu ![]() Beginner ![]() Joined: 29 Jun 09 Location: Minnesota Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() |
Ingo,
thanks but I am looking for the opposite example. Take the TImage canvas and write it to the QPdoc.
I guess:
image1.Picture.Bitmap.SaveToStream();
qp.loadFromStream ...
didn't want to start a new subject since this was on point. I always use forums by clicking on
'New Messages' or 'Unread Messages'.
TIA
RT
|
|
![]() |
|
DELBEKE ![]() Debenu Quick PDF Library Expert ![]() ![]() Joined: 31 Oct 05 Location: France Status: Offline Points: 151 |
![]() ![]() ![]() ![]() ![]() |
//set orgin at the upper left corner
Qp.SetOrigin(1);
//load image from a stream
// option can specify the page number if the image is a multi-page, 0 otherwhise
Id = Qp.AddImageFromStream(MyStream, Option);
//select the image
Qp.SelectImage(Id);
//draw the image
Qp.DrawImage(10,10,100,100);
Edited by DELBEKE - 30 Jun 09 at 3:03PM |
|
![]() |
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