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 - Problem with RenderPageToStream
  FAQ FAQ  Forum Search   Register Register  Login Login

Problem with RenderPageToStream

 Post Reply Post Reply
Author
Message
aderg View Drop Down
Beginner
Beginner
Avatar

Joined: 24 Oct 19
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote aderg Quote  Post ReplyReply Direct Link To This Post Topic: Problem with RenderPageToStream
    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?
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: 03 Apr 20 at 11:21AM
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

Back to Top
aderg View Drop Down
Beginner
Beginner
Avatar

Joined: 24 Oct 19
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote aderg Quote  Post ReplyReply Direct Link To This Post Posted: 03 Apr 20 at 11:38AM
Yes, both objects point to the same file. Thanks, I'll try to make a copy of the file
Back to Top
aderg View Drop Down
Beginner
Beginner
Avatar

Joined: 24 Oct 19
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote aderg Quote  Post ReplyReply Direct Link To This Post Posted: 03 Apr 20 at 12:23PM
I tried making a copy of the file using SaveToStream/LoadFromStream - same problem.. ((
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: 03 Apr 20 at 4:28PM
...wasn't really threadsave...

Cheers,
Ingo

Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 03 Apr 20 at 5:46PM
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.
Back to Top
aderg View Drop Down
Beginner
Beginner
Avatar

Joined: 24 Oct 19
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote aderg Quote  Post ReplyReply Direct Link To This Post Posted: 04 Apr 20 at 12:06AM
Originally posted by tfrost tfrost wrote:

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.

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
Back to Top
aderg View Drop Down
Beginner
Beginner
Avatar

Joined: 24 Oct 19
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote aderg Quote  Post ReplyReply Direct Link To This Post Posted: 04 Apr 20 at 12:23AM
"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
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: 05 Apr 20 at 10:23PM
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

Back to Top
aderg View Drop Down
Beginner
Beginner
Avatar

Joined: 24 Oct 19
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote aderg Quote  Post ReplyReply Direct Link To This Post Posted: 06 Apr 20 at 7:16AM
I solved the problem using DPLR renderer and RenderPageToDC
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