[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-poppler
Subject:    [poppler] utils/pdftoppm.1 utils/pdftoppm.cc
From:       GitLab Mirror <gitlab-mirror () kemper ! freedesktop ! org>
Date:       2019-12-27 22:33:21
Message-ID: 20191227223321.4561B76155 () kemper ! freedesktop ! org
[Download RAW message or body]

 utils/pdftoppm.1  |    3 +++
 utils/pdftoppm.cc |   10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 7de14f43562f4064d7b4cf1264e6cc8a89e6f4f2
Author: Sébastien Berthier <s.berthier@bee-buzziness.com>
Date:   Tue Dec 24 10:09:02 2019 +0100

    pdftoppm: add -hide-annotations option

diff --git a/utils/pdftoppm.1 b/utils/pdftoppm.1
index 56808cd0..472f6f21 100644
--- a/utils/pdftoppm.1
+++ b/utils/pdftoppm.1
@@ -83,6 +83,9 @@ Specifies the size of crop square in pixels (sets W and H)
 .B \-cropbox
 Uses the crop box rather than media box when generating the files
 .TP
+.B \-hide-annotations
+Do not show annotations
+.TP
 .B \-mono
 Generate a monochrome PBM file (instead of a color PPM file).
 .TP
diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc
index 68006c5b..c21bb324 100644
--- a/utils/pdftoppm.cc
+++ b/utils/pdftoppm.cc
@@ -88,6 +88,7 @@ static int param_y = 0;
 static int param_w = 0;
 static int param_h = 0;
 static int sz = 0;
+static bool hideAnnotations = false;
 static bool useCropBox = false;
 static bool mono = false;
 static bool gray = false;
@@ -159,6 +160,8 @@ static const ArgDesc argDesc[] = {
    "size of crop square in pixels (sets W and H)"},
   {"-cropbox",argFlag,     &useCropBox,    0,
    "use the crop box rather than media box"},
+  {"-hide-annotations", argFlag,  &hideAnnotations,    0,
+   "do not show annotations"},
 
   {"-mono",   argFlag,     &mono,          0,
    "generate a monochrome PBM file"},
@@ -288,6 +291,10 @@ static bool parseJpegOptions()
   return true;
 }
 
+static auto annotDisplayDecideCbk = [](Annot *annot, void *user_data) {
+  return !hideAnnotations;
+};
+
 static void savePageSlice(PDFDoc *doc,
                    SplashOutputDev *splashOut, 
                    int pg, int x, int y, int w, int h, 
@@ -301,7 +308,8 @@ static void savePageSlice(PDFDoc *doc,
     pg, x_resolution, y_resolution, 
     0,
     !useCropBox, false, false,
-    x, y, w, h
+    x, y, w, h,
+    nullptr, nullptr, annotDisplayDecideCbk, nullptr
   );
 
   SplashBitmap *bitmap = splashOut->getBitmap();
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic