Print Page | Close Window

Exception message while rendering

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1177
Printed Date: 27 Sep 24 at 5:19PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Exception message while rendering
Posted By: bernr
Subject: Exception message while rendering
Date Posted: 16 Aug 09 at 2:28PM
Hello,
  I seem to be having another problem rendering a PDF.
When I try to render the pdf located at http://www.exitcare.com/downloads/PDFs/01MVC.pdf using the following code

procedure TForm1.RenderPDF(asFileName: string; aiPageNumber: integer);
var
  PDF_File: TQuickPDF0715;
  iDPI: Integer;
  iRenderType: integer;
  PDF_stream: Tmemorystream;
begin
  iDPI := 75;
  iRenderType := 5;
  PDF_File := TQuickPDF0715.Create;
  try
    PDF_stream := Tmemorystream.create;
    try
      PDF_File.UnlockKey('INSERT_LICENSE_KEY_HERE');
      PDF_File.LoadFromFile(asFileName);

      PDF_File.RenderPageToStream(iDPI, aiPageNumber, iRenderType, PDF_stream);
    finally
      PDF_File.Free;
    end;
    PDF_stream.Seek(0, 0);
    imageEn.IO.LoadFromStream(PDF_stream);
  finally
    freeandnil(PDF_File);
  end;
end;

I receive the following Exception message when doing the RenderPageToStream:

Project qpdftest.exe raised exception class Exception with message ''.

This PDF loads find in Adobe, and if I ignore the Exception message the PDF will render (although slower then expected).

This all done using QPDF 7.15

Thanks Bern




Replies:
Posted By: Ingo
Date Posted: 17 Aug 09 at 6:28AM
Hi!

Have a try with iRenderType 0 or 1 ... The same result?
All functions deliver a returning value to show if it's all okay or not.
What are the values?

A short time ago i've posted a sample here ... try it and compare with your code.

Cheers, Ingo



Posted By: bernr
Date Posted: 17 Aug 09 at 1:51PM
After I either continue past all the errors, our tell it to ignore the error, the return code is a 1 and it renders the PDF. Happes with all IRenterTypes.

RenderToString and RenderToFile also gives the same error message, I have not tried RenderToDC or RenderToVariant.


If you are talking about the sample code you had in my other post on how you render, I tried it and got the same error on the RenderToStream line.

Thanks Bern.



Posted By: bernr
Date Posted: 18 Aug 09 at 8:08PM
Any Thoughts?


Posted By: Rowan
Date Posted: 27 Aug 09 at 4:54AM
Hi Bern,

I've tested the PDF with both your code and Ingo's code and I have encountered the same problem. The problem as you know is specific to this one PDF. We'll examine the PDF to see what aspect of it the library is having trouble processing and try to provide a fix as soon as possible.

Cheers,
- Rowan.


Posted By: bernr
Date Posted: 27 Aug 09 at 5:04AM
Actually it is not just this one PDF, I have about 50 it happens with.


Posted By: Rowan
Date Posted: 27 Aug 09 at 5:12AM
Do the 01HDINJ.pdf and 02EYE.pdf documents render OK on your end using this function?

If you're experiencing the same problem with 50 odd documents then I presume that these documents are all coming from the same producer? I noticed that the 01MVC.pdf document came from Neevia docuPrinter, is that true for the other documents as well?

I can arrange an FTP dropbox if you would like to send us all 50 files and we can run tests on them to see if there is a problem that is common in all of them.

I've sent you an email from our support system, so when you reply to that I can send you the FTP dropbox details.

Cheers,
- Rowan.


Posted By: Ingo
Date Posted: 27 Aug 09 at 7:15PM
Hi!

Jean-Luc tried it with the last QuickPDF-version but RenderToPage and it works.
He'll try tomorrow RenderPageToStream, too... and we'll see.

Cheers, Ingo



Posted By: bernr
Date Posted: 27 Aug 09 at 10:32PM
No the 01HDINJ.pdf and 02EYE.pdf documents do not give the error, they just have the other rendering issue.

And yes all documents are coming from Docuprinter (this was our temp work around until the rendering problem I reported was fixed), but not all documents from Docuprinter give the error, we have quite a few that were produced with Docuprinter that do not.


Posted By: bernr
Date Posted: 27 Aug 09 at 10:33PM
Ingo, when you are testing, are you testing from the IDE or from the compiled exe? Because I have noticed the problem from within the IDE


Posted By: Ingo
Date Posted: 28 Aug 09 at 6:05AM
"...
I have noticed the problem from within the IDE
..."

So it's not a QuickPDF-prob but a settings-prob of your IDE?
A new option to be checked.

Cheers, Ingo



Posted By: DELBEKE
Date Posted: 28 Aug 09 at 6:33AM
Hi bern
My test was done from the exe and the ide, and i have not found any problem with rendering with RenderPage. (I use VB6 and the activeX version)
 
Cheers, Jean-Luc


Posted By: bernr
Date Posted: 28 Aug 09 at 12:49PM
as I have said I am using RenderPageToStream and running from the EXE I do not get the error, only when running from the IDE (on one machine). My concern here is that with it having so many errors (I have clicked in the IDE to continue past like 10 errors before I gave up) that it is slowing down the rendering, or not rendering correctly parts of the PDF.

And I doubt Ingo that the statement "it's not a QuickPDF-prob but a settings-prob of your IDE?" is correct, since Rowan was also able to reproduce the same thing.



Posted By: marian_pascalau
Date Posted: 28 Aug 09 at 1:35PM
Hi there,
this looks lile an exception inside debugger. When program is running inside a debugger, all exceptions are cached by your Debugger but still handled by the running program. A debugger my say that an error is thrown and this may not be always an error !!!
 
Because the exception is handled correctly it means that the exe is working. Just ignore this problem. If your program is working then everything is ok. If something is missing (in output) there is a possible bug inside your library and somebody must investigate on the original SourceCode.
 
Hope this helps :-) ....



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk