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!
Blank bitmaps from RenderDocumentToFile |
Post Reply |
Author | |
Pirmin
Team Player Joined: 28 Nov 05 Status: Offline Points: 28 |
Post Options
Thanks(0)
Posted: 04 Jan 06 at 3:12AM |
Hello, The following C# program works good for some PDF documents, but for the iSED manual it doesn't work at all. using System; string file = "iSEDQuickPDF 5.11 Reference Guide.pdf"; Console.Write( "Loading PDF file " + file ); if ( result == 1 ) Console.WriteLine( "Finished!" ); Could please somebody try this program, ported to Delpi, ActiveX or something else? Thanks in advance. Best regards, Edited by Pirmin |
|
swb1
Debenu Quick PDF Library Expert Joined: 05 Dec 05 Location: United States Status: Offline Points: 100 |
Post Options
Thanks(0)
|
I tried the following in Delphi. I got the same results that you did , Pirmin. procedure TForm1.Button3Click(Sender: TObject); I then changed my code to this : procedure TForm1.Button3Click(Sender: TObject); var qp : TiSEDQuickPDF; i : integer; stream : TMemoryStream; bmp : TBitmap; begin if OpenDialog1.Execute then begin stream := TMemoryStream.Create; bmp := TBitmap.Create; qp := TiSEDQuickPDF.Create; try qp.UnlockKey(MY_QDPF_KEY); qp.LoadFromFile(OpenDialog1.FileName ); Screen.Cursor := crHourGlass; for i := 1 to qp.PageCount do begin stream.Clear; qp.RenderPageToStream(72,i,0,stream ); stream.Position := 0 ; bmp.LoadFromStream( stream ); bmp.SaveToFile(ExtractFilePath(OpenDialog1.FileName) + Format('ISedDoc%d.bmp',[ i ])); end; finally Screen.Cursor := crDefault; stream.Free; bmp.Free; qp.Free; end; end; end; This took longer to run however the resulting bitmap files appeared to be correct. I dont know the equivalent structures for TMemoryStream and TBitmap in C# however this is the method I have used in the past (with Delphi) and it has work reliably for me. Perhaps when I find myself with some time on my hands I will step through the RenderDocumentToFile function and see if I can tell why it is yielding null Bitmaps. Steve Edited by swb1 |
|
Pirmin
Team Player Joined: 28 Nov 05 Status: Offline Points: 28 |
Post Options
Thanks(0)
|
Hi Steve Thank you! When I was reading the code in your post, it looked a kind of familiar to me. Best regards, Edited by Pirmin |
|
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