From e3d4e90edf2929a6fa8ed29a0d319e67aaac22ac Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sun, 14 Sep 2014 22:30:40 +0930 Subject: [PATCH 9/9] pdftocairo: ensure output_file is NULL when printing to win32 to ensure that endDocument won't try to close the file --- utils/pdftocairo.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/pdftocairo.cc b/utils/pdftocairo.cc index 2cc4d4e..701571d 100644 --- a/utils/pdftocairo.cc +++ b/utils/pdftocairo.cc @@ -498,7 +498,9 @@ static cairo_status_t writeStream(void *closure, const unsigned char *data, unsi static void beginDocument(GooString *inputFileName, GooString *outputFileName, double w, double h) { if (printing) { - if (!print) { + if (print) { + output_file = NULL; + } else { if (outputFileName->cmp("fd://0") == 0) output_file = stdout; else -- 2.1.0