One can switch between pages until a page is finished with cpdf_finalize_page().
The cpdf_set_current_page() function set the page on which all operations are performed. One can switch between pages until a page is finished with cpdf_finalize_page().