diff --git a/xpra/platform/win32/pdfium.py b/xpra/platform/win32/pdfium.py index c9cca9c05c..cdbdc96912 100755 --- a/xpra/platform/win32/pdfium.py +++ b/xpra/platform/win32/pdfium.py @@ -142,10 +142,11 @@ def do_print_pdf(hdc, title=b"PDF Print Test", pdf_data=None): log("FPDF_LoadPage()=%s page %i loaded", page, i) StartPage(hdc) FPDF_RenderPage(hdc, page, x, y, w, h, rotate, flags) - FPDF_ClosePage(hdc) EndPage(hdc) + FPDF_ClosePage(page) log("FPDF_RenderPage page %i rendered", i) finally: + FPDF_CloseDocument(doc) EndDoc(hdc) finally: FPDF_DestroyLibrary()