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!
![]() |
Rendering |
Post Reply ![]() |
Author | |
MrPopup ![]() Team Player ![]() ![]() Joined: 19 Dec 05 Location: New Zealand Status: Offline Points: 32 |
![]() ![]() ![]() ![]() ![]() 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.
![]() Edited by MrPopup - 25 Mar 18 at 3:45AM |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
tfrost ![]() Senior Member ![]() Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
![]() ![]() ![]() ![]() ![]() |
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!
|
|
![]() |
|
MrPopup ![]() Team Player ![]() ![]() Joined: 19 Dec 05 Location: New Zealand Status: Offline Points: 32 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
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