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 - RenderpagetoDC example needed
  FAQ FAQ  Forum Search   Register Register  Login Login

RenderpagetoDC example needed

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


Joined: 08 Dec 05
Location: Australia
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote rogerad Quote  Post ReplyReply Direct Link To This Post Topic: RenderpagetoDC example needed
    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
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: 19 Mar 09 at 7:45AM
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
 
Back to Top
Rowan View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 10 Jan 09
Status: Offline
Points: 398
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rowan Quote  Post ReplyReply Direct Link To This Post Posted: 25 Mar 09 at 12:57AM
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
Back to Top
RhoTu View Drop Down
Beginner
Beginner


Joined: 29 Jun 09
Location: Minnesota
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote RhoTu Quote  Post ReplyReply Direct Link To This Post Posted: 29 Jun 09 at 10:40PM
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
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: 30 Jun 09 at 6:45AM
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
Back to Top
RhoTu View Drop Down
Beginner
Beginner


Joined: 29 Jun 09
Location: Minnesota
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote RhoTu Quote  Post ReplyReply Direct Link To This Post Posted: 30 Jun 09 at 2:43PM
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
Back to Top
DELBEKE View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert
Avatar

Joined: 31 Oct 05
Location: France
Status: Offline
Points: 151
Post Options Post Options   Thanks (0) Thanks(0)   Quote DELBEKE Quote  Post ReplyReply Direct Link To This Post Posted: 30 Jun 09 at 3:02PM
//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
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