Print Page | Close Window

RenderPageToDC in thread

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=2604
Printed Date: 01 Jul 24 at 5:46AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: RenderPageToDC in thread
Posted By: goobit
Subject: RenderPageToDC in thread
Date Posted: 20 Apr 13 at 4:56PM

Hi everybody.

Two weeks ago I post an issue with rendering in separate thread: 

https://quickpdf.fogbugz.com/default.asp?18390_auaga7jpi7kq2ihs - https://quickpdf.fogbugz.com/default.asp?18390_auaga7jpi7kq2ihs

Unfortunately it is leaved without response and I wonder is there anyone who could help me. I mean to at least to test this project on your environment and confirm that problem exists (it is also possible that I somehow incorrectly use the library but I not found any "thread" related topics except that it should work).

You can download test project from the issue attach (url above). Also I repeat a bug explanation:

I use TDebenuPDFLibrary in TThread execute for pages render. And
sometimes the result page is blank (when rendering runs in the main
thread all ok).

When page renders simply by call:

  RenderPageToDC(72, 1, Bitmap.Canvas.Handle);

then offen exception raises in TCanvas.GetHandle where Self = Nil (It
comes from TPDFPicasso.BeginPath where seems Canvas is Nil). But this
exception handles somewhere inside QuickPDF and RenderPageToDC just
returns 1 and blank bitmap. If this call wrap with this:

  Bitmap.Canvas.Lock;
  try
    . . .
  finally
    Bitmap.Canvas.Unlock;
  end;

exceptions not occurs but blank pages still exists (to increase a
chance to catch it just move the mouse cursor over main window; it
generates repaint calls in main thread that seems significant).





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