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 - Good PDFs shown as 1 blank page
  FAQ FAQ  Forum Search   Register Register  Login Login

Good PDFs shown as 1 blank page

 Post Reply Post Reply
Author
Message
RedOctober View Drop Down
Team Player
Team Player


Joined: 12 Oct 10
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedOctober Quote  Post ReplyReply Direct Link To This Post Topic: Good PDFs shown as 1 blank page
    Posted: 18 Feb 12 at 6:52AM
Environment:  D7, QwkPdfLib 8.13, XP, Win2003/2008

In my application, I use QuickPDF Lib to display .Pdf files.  All the .Pdf files have at least one page, with text and/or images on them.  Occasionally, my users experience a bug where the known good .Pdf is displayed as being one blank page.  The problem goes away if the user shuts down the application and restarts it.

Is there a bug in 8.13 that is causing this?  I've never had this happen before in any previous version of QuickPdfLib.  I have not changed any other code.  (ie:  I upgraded my QuickPdfLib, then he problem appeared)


Edited by RedOctober - 18 Feb 12 at 6:52AM
Back to Top
edvoigt View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 Mar 11
Location: Berlin, Germany
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote edvoigt Quote  Post ReplyReply Direct Link To This Post Posted: 18 Feb 12 at 9:06AM
Hi,

it looks for me as a problem of lost/missing memory-space or anything around. Do you check result of used render-function?

Werner
Back to Top
RedOctober View Drop Down
Team Player
Team Player


Joined: 12 Oct 10
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedOctober Quote  Post ReplyReply Direct Link To This Post Posted: 18 Feb 12 at 2:46PM
Hi Werner,

I've done a complete and exhaustive memory chip check, so I know that the memory chips are good.  I use RenderPageToStream with a BMP output.  In the reference manual there is a return type of Integer, but no listing of what integer constitutes success for failure.  I'll assume that zero is "bad" and non-zero is "good".   It would be helpful if the manual described what the problem is if a zero is encountered.
Back to Top
edvoigt View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 Mar 11
Location: Berlin, Germany
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote edvoigt Quote  Post ReplyReply Direct Link To This Post Posted: 18 Feb 12 at 3:11PM
Hi,

I assume no problem with your harware, but problems inside your program with unfreed memory after using it, so that there is no more enough for rendering. Therefore the advice to check result. It seems to be an error in documentation.

What is written for RenderpageToDC:

0 Page could not be rendered
1 Page was rendered successfully

should be valid for all other renderfunctions too. Most functions of QPL give a zero-result in error-case.

For rendering I see only two basics for error:
- PDF with errors inside - not the case, because it is later working
- not enough memory - therefore I look only in this direction.

I use this RenderToStream too and I have sometimes problems with big (and/or complex) PDF-Pages. It was ever a space-question. Have a look, what is at the same time in memory:
1. PDF-document
2. Streamoutput from RenderPageToStream
3. BMP after filling from stream
4. control, which at last shows the image to the user

After 2. you may perhaps free QPL
After 3. the stream may be freed (BMP holds data)

It is anything in this direction if program shows the image on screen in the first run. And later only if you restart (it means automatically freeing all used memory).


Did you try the same PDFs with an older QPL-version?

In hope to be right and not showing a wrong way,

Werner

Remark: Using DARenderPageToStream helps to reduce needed memory too.


Edited by edvoigt - 22 Feb 12 at 2:35PM
Back to Top
RedOctober View Drop Down
Team Player
Team Player


Joined: 12 Oct 10
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedOctober Quote  Post ReplyReply Direct Link To This Post Posted: 18 Feb 12 at 3:27PM
Your comments are very helpful Werner.   I did not even realize I could check for the output  (due to missing documentation).  Maybe I am doing something dum like asking the Pdf to render page -1 (instead of a + number) or something like that.  Now that I know I can check for a failed output, it will guide me closer to the solution.  Thank you.
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 22 Feb 12 at 2:35PM
When you finish with a document make you call QP.RemoveDocument to unload the PDF.

  if (LoadFromFile("large.pdf", "") == 1)
  {
     int docID = QP.SelectedDocument();

     // process your PDF here etc..
    
     // finished. Now free the memory.

     QP.RemoveDocument(dicID);
  }

Back to Top
RedOctober View Drop Down
Team Player
Team Player


Joined: 12 Oct 10
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedOctober Quote  Post ReplyReply Direct Link To This Post Posted: 26 Feb 12 at 8:44PM
To close off this ticket, I have discovered that there is some unknown third party component that is changing the FPU RoundMode to rmDown, away from the default of rmNearest.   When the problem occurs, I can programatically fix it, simply by calling     SetRoundMode(rmNearest).

Now I know the why, but not the what.   I don't know which component is leaving the RoundMode setting in the wrong state.   So I am left with sprinkling SetRoundMode(rmNearest) before/after events that I think are suspect.

I am on the right track now, and this work around may be my only recourse.


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