Q: We have a little problem about how to update a PDF view after we
fill-in some form fields. If we fill the form elements and we update
our view (using pdfview.Update()), there is a flicker. We know that
this occurs from a view-updating process. But our customer doesn’t
like it. Can you recommend a method to remove the flicking effect?
A: I guess that the flicker is caused due to a page refresh (because
the entire page is drawn progressively).
To eliminate the flicker try setting progressive rendering to
‘false’ (you can uncomment the corresponding line in PDFView sample
project):
pdfview.SetProgressiveRendering(false);
Please let me know if this works for you. If it doesn’t we could look
at some other options.
Q: I have to apologize you that I did not tell you about our sdk
version.
We are not using .NET or Java version of PDFNet SDK. We use the C++
version (PDFView sample for MFC) on Windows. Could you please tell me
another way for solving this problem?
A: We are in the process of implementing a utility Win32 control that
will offer pre-canned PDF view control similar to the one in C#/Java.
This utility will simplify use of PDFView class in interactive C/C++
applications. In the meantime, you can implement non-progressive
rendering (in C/C++) as follows:
void BeginRendering(void* data) {
DrawTimer* t = (DrawTimer*) data;
t->is_finished = false;
}
void FinishedRendering(void* data, bool canceled) {
DrawTimer* t = (DrawTimer*) data;
if (t->hwnd) {
t->is_finished = true;
}
DrawTimerProc(t->hwnd, WM_TIMER, DRAW_TIMER_ID, 0); // Last refresh.
}
- In OnDraw() method add the extra condition to paint the view only
when the rendering is finished:
void CPDFViewView::OnDraw(CDC* pDC)
{
if (GetDocument()->mp_doc.get()) // if the document is attached to
this view.
{
const char* buf = m_view.GetBuffer();
if (buf && m_draw_timer.is_finished)
{
…