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!
Problem with RenderPageToStream |
Post Reply |
Author | |
aderg
Beginner Joined: 24 Oct 19 Status: Offline Points: 11 |
Post Options
Thanks(0)
Posted: 03 Apr 20 at 11:00AM |
I use RenderPageToStream in the background thread to create page preview. A separate object TQuickPDF is created in the thread. But if there are several pictures on the page, sometimes not all pictures are displayed. How can this problem be solved? Screenshot is here http://yadi.sk/i/vfupmnvn8wp2Kw
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi,
but both objects points to the same file? I don't have much experiences regarding issues like this but as far as i know at least in the past QuickPDF wasn't really threadsave? Perhaps someone other can advice you a bit deeper... But anyway... Cheers and welcome here for now, Ingo |
|
Cheers,
Ingo |
|
aderg
Beginner Joined: 24 Oct 19 Status: Offline Points: 11 |
Post Options
Thanks(0)
|
Yes, both objects point to the same file. Thanks, I'll try to make a copy of the file
|
|
aderg
Beginner Joined: 24 Oct 19 Status: Offline Points: 11 |
Post Options
Thanks(0)
|
I tried making a copy of the file using SaveToStream/LoadFromStream - same problem.. ((
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
...wasn't really threadsave...
|
|
Cheers,
Ingo |
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
I find QPDF to be thread-safe for our purposes (rendering PDFs to bitmap). It's the optional PDFIUM DLL that is more likely to fail with multiple threads.
If you suspect a threading issue it might be worth running Sysinternals Process Monitor and filtering on some of your image files that fail to show. It would indicate any failure to open a file and tell you whether the reason was a sharing violation.
|
|
aderg
Beginner Joined: 24 Oct 19 Status: Offline Points: 11 |
Post Options
Thanks(0)
|
The problem is not with different files, but with different pages of the same file. And only when using the background thread, if you do in the main thread, it is ok
|
|
aderg
Beginner Joined: 24 Oct 19 Status: Offline Points: 11 |
Post Options
Thanks(0)
|
I used the information from here http://www.debenu.com/kb/is-debenu-pdf-library-thread-safe/ "Debenu Quick PDF Library can be used in a multi-threaded environment so
long as a separate instance of the library is created by each thread" I developed a test application. In the background stream, previews are created, but some images on the pages are sometimes skipped. Screenshot here http://yadi.sk/i/JdZlZ5-4gd341g You can look at the source code, maybe you can tell me something
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
This won't work:
procedure TfrmMain.btOpenClick(Sender: TObject); begin if OpenDialog1.Execute(Handle) then begin LoadPDF(OpenDialog1.FileName); LoadPDF2(OpenDialog1.FileName); end; end; Please don't forget that this is a user-forum - not a helping forum from the publishers ;-) |
|
Cheers,
Ingo |
|
aderg
Beginner Joined: 24 Oct 19 Status: Offline Points: 11 |
Post Options
Thanks(0)
|
I solved the problem using DPLR renderer and RenderPageToDC
|
|
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