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

Rendering

 Post Reply Post Reply
Author
Message
MrPopup View Drop Down
Team Player
Team Player
Avatar

Joined: 19 Dec 05
Location: New Zealand
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote MrPopup Quote  Post ReplyReply Direct Link To This Post Topic: Rendering
    Posted: 25 Mar 18 at 3:42AM
Using Windows DLL V13. Would like to be able to render a page to an image but not to a file. That is have the image binary returned (renderPageToBinary). Have tried all combinations but no joy. At present I renderPageToFile and then read the file. Very slow and inefficient. Appreciate any help. Thank you. Cheers.Smile

Edited by MrPopup - 25 Mar 18 at 3:45AM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 2676
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 25 Mar 18 at 3:35PM
Hi MrPopup ;-)

here you can get an idea how you can do it without rendering to a file.
I did it with RenderPageToStream and it works well for me:

// . . .

   QP  := TDebenuPDFLibrary1211.Create;
   try
      QP.UnlockKey('...');
      QP.LoadFromFile(Edit1.Text, '');
      If ( QP.EncryptionStatus > 0 ) Then
         QP.Decrypt;
      pmax := QP.PageCount;
      Form4.Label1.Caption := '1 from ' + IntToStr(pmax)
      QP.CombineContentStreams;
      test_stream := TMemoryStream.Create;
      if ( zoom = 0 ) then
         zoom := 72;
      QP.RenderPageToStream(zoom,1,1,test_stream);
   finally
      QP.Free;
   end;
  
// . . .

   try
      test_stream.Seek(0,0);
      jpg := TJPEGImage.Create;
      jpg.LoadFromStream (test_stream);
      Form4.Image1.Picture.Assign(jpg);
      Form4.Label1.Caption := '1' + ' from ' + IntToStr(pmax)
   finally
      test_stream.Free;
      jpg.Free;
   end;

// . . .


Cheers,
Ingo

Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 170
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 25 Mar 18 at 5:51PM
I think RenderPageToStream is Delphi only, and a user of the DLL edition is unlikely to be using Delphi. I believe that with the DLL edition you can use the 'render to string' function, but I have never tried this.  I assume that it is going to render to a (byte *) rather than the (char *) that is documented.  The DLL 'getting started' guide implies that with function names ending 'ToString' you have to copy the 8-bit-data result out of the buffer before calling the function again.  It's one of the reasons I never looked further at the DLL edition!
Back to Top
MrPopup View Drop Down
Team Player
Team Player
Avatar

Joined: 19 Dec 05
Location: New Zealand
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote MrPopup Quote  Post ReplyReply Direct Link To This Post Posted: 27 Mar 18 at 1:07AM
Thank you ingo and tfrost.
Appreciate you taking the time to respond.I have previously tried all renderTo options but will try again. 
As tfrost surmised I am not using Delphi - my development environment is Jade (www.jadeworld.com).
ToString does return something but I cannot use the returned data - it does not appear to be an image.
Will keep you posted as to success or not.
Again, thanks.
Cheers.


Edited by MrPopup - 27 Mar 18 at 1:10AM
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