TUTORIAL - Render Part of the Page
Very often you don’t want to re-render the whole page because it might be time consuming, you just want to re-render the area that needs to be re-painted. FPDF_RenderPage supports partial rendering through the standard Windows clip box mechanism,that is, if you have clip box correctly set, FPDF_RenderPage automatically render only page objects (texts, graphics, or images) inside the clip box.
You can set the clip box implicitly using WIN32 function InvalidateRect, or, call one of the clipping WIN32 functions (like SelectClipPath) to set the clip box explicitly.
Here is an example showing how you can call InvalidateRect to set a clip box, so only the partial page will be re-rendered. We assume you have handled WM_PAINT message correctly by calling FPDF_RenderPage function.

RECT rect;
int left, right, top, bottom;
…
rect.left = left;
rect.right = right;
rect.top = top;
rect.bottom = bottom;
InvalidateRect(hWnd, &rect, TRUE);
Note: for correctly re-render the page content; you MUST clear the drawing area first, as we indicated in the last parameter of InvalidateRect function call. And you need to handle WM_ERASEBKGND function to fill the background with pure white.
Copyright ? 2011 Foxit Corporation. All Rights Reserved.
No part of this document can be reproduced, transferred, distributed or stored in any format without the prior written permission of Foxit.
Anti-Grain Geometry - Version 3.0, Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com). FreeType2 (freetype2.2.1), Copyright (C) 1996-2001, 2002, 2003, 2004| David Turner, Robert Wilhelm, and Werner Lemberg. LibJPEG (jpeg V6b 27-Mar-1998), Copyright (C) 1991-1998 Independent JPEG Group. ZLib (zlib 1.2.2), Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler. Little CMS, Copyright (C) 1998-2004 Marti Maria. Kakadu, Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW). PNG, Copyright (C) 1998-2009 Glenn Randers-Pehrson. LibTIFF, Copyright (C) 1988-1997 Sam Leffler and Copyright (C) 1991-1997 Silicon Graphics, Inc.
Permission to copy, use, modify, sell and distribute this software is granted provided this copyright notice appears in all copies. This software is provided "as is" without express or im-plied warranty, and with no claim as to its suitability for any purpose.