[poppler] 3 commits - utils/pdftocairo.1 utils/pdftocairo.cc

Adrian Johnson ajohnson at kemper.freedesktop.org
Mon Jan 11 02:11:49 PST 2016


 utils/pdftocairo.1  |    9 +++++----
 utils/pdftocairo.cc |   15 +++++++++------
 2 files changed, 14 insertions(+), 10 deletions(-)

New commits:
commit 819bea740b1fadb24833e0ecbdf4e75ddca8eb14
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Mon Jan 11 19:44:14 2016 +1030

    pdftocairo: ensure surface flushed before accessing image data

diff --git a/utils/pdftocairo.cc b/utils/pdftocairo.cc
index 1bd6074..a7257b4 100644
--- a/utils/pdftocairo.cc
+++ b/utils/pdftocairo.cc
@@ -351,6 +351,7 @@ void writePageImage(GooString *filename)
   height = cairo_image_surface_get_height(surface);
   width = cairo_image_surface_get_width(surface);
   stride = cairo_image_surface_get_stride(surface);
+  cairo_surface_flush(surface);
   data = cairo_image_surface_get_data(surface);
 
   if (!writer->init(file, width, height, x_resolution, y_resolution)) {
commit f7542348b37cc881d854bbc36c3af0a4fe37d839
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Mon Jan 11 19:39:34 2016 +1030

    pdftocairo: document that -singlefile appends file type
    
    Bug 86254

diff --git a/utils/pdftocairo.1 b/utils/pdftocairo.1
index 7575cab..a7bfb23 100644
--- a/utils/pdftocairo.1
+++ b/utils/pdftocairo.1
@@ -1,4 +1,4 @@
-.TH pdftoppm 1
+.TH pdftocairo 1
 .SH NAME
 pdftocairo \- Portable Document Format (PDF) to PNG/JPEG/TIFF/PDF/PS/EPS/SVG using cairo
 .SH SYNOPSIS
@@ -32,9 +32,10 @@ reads the PDF file,
 and writes to
 .IR output-file .
 The image formats (PNG, JPEG, and TIFF) generate one file per page with the page number and file type appended to
-.IR output-file
-(except when \-singlefile is used).
-When the output format is a vector format (PDF, PS, EPS, and SVG) or when \-singlefile is used,
+.IR output-file .
+qWhen \-singlefile is used with the image formats, the file type is appended to
+.IR output-file .
+When the output format is a vector format (PDF, PS, EPS, and SVG),
 .IR output-file
 is the full filename.
 
commit 9fa58b1ef6c97e2a30bb3197c11000fac3b059f4
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Mon Jan 11 19:26:02 2016 +1030

    pdftocairo: fix writing to stdout out with image output

diff --git a/utils/pdftocairo.cc b/utils/pdftocairo.cc
index ccdead1..1bd6074 100644
--- a/utils/pdftocairo.cc
+++ b/utils/pdftocairo.cc
@@ -725,12 +725,14 @@ static GooString *getImageFileName(GooString *outputFileName, int numDigits, int
     snprintf(buf, sizeof(buf), "-%0*d", numDigits, page);
     imageName->append(buf);
   }
-  if (png)
-    imageName->append(".png");
-  else if (jpeg)
-    imageName->append(".jpg");
-  else if (tiff)
-    imageName->append(".tif");
+  if (outputFileName->cmp("fd://0") != 0) {
+    if (png)
+      imageName->append(".png");
+    else if (jpeg)
+      imageName->append(".jpg");
+    else if (tiff)
+      imageName->append(".tif");
+  }
 
   return imageName;
 }


More information about the poppler mailing list