Package: gscan2pdf
Version: 1.2.5-1
Severity: wishlist
Tags: patch

In the Unpaper module, please (a) allow for negative border margins to be set
and (b) add support for the '--sheet-size' option.  The combination of these
two features allows for completely "clean" (no residual borders, pages properly
sized and aligned) output from my ScanSnap S1300 from within gscan2pdf.

The attached patch (poorly) implements the above request.



-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_CA.utf8, LC_CTYPE=en_CA.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gscan2pdf depends on:
ii  imagemagick                  8:6.7.7.10+dfsg-2
ii  libconfig-general-perl       2.56-1
ii  libgoo-canvas-perl           0.06-2
ii  libgtk2-ex-simple-list-perl  0.50-2
ii  libgtk2-imageview-perl       0.05-2
ii  libhtml-parser-perl          3.71-1+b1
ii  liblist-moreutils-perl       0.33-2
ii  liblocale-gettext-perl       1.05-8
ii  liblog-log4perl-perl         1.43-1
ii  libpdf-api2-perl             2.021-1
ii  libproc-processtable-perl    0.50-1
ii  libreadonly-perl             1.04-1
ii  librsvg2-common              2.40.2-1
ii  libsane-perl                 0.05-2+b1
ii  libset-intspan-perl          1.19-1
ii  libtiff-tools                4.0.3-8
ii  libtry-tiny-perl             0.22-1
ii  perlmagick                   8:6.7.7.10+dfsg-2
ii  sane-utils                   1.0.24-1.1+b1

Versions of packages gscan2pdf recommends:
ii  djvulibre-bin              3.5.25.4-4
ii  libgtk2-ex-podviewer-perl  0.18-1
ii  sane                       1.0.14-9
ii  tesseract-ocr              3.03.03-1
ii  unpaper                    0.4.2-1
ii  xdg-utils                  1.1.0~rc1+git20111210-7.1

gscan2pdf suggests no packages.
--- Unpaper.pm.diverted	2014-05-17 06:52:22.000000000 -0500
+++ Unpaper.pm	2014-05-19 15:43:33.251895510 -0500
@@ -59,6 +59,25 @@
    },
    default => 'single',
   },
+  'sheet-size' => {
+   type    => 'ComboBox',
+   string  => $d->get('Sheet size'),
+   options => {
+    none => {
+     string => $d->get('(none)'),
+     tooltip => $d->get(''),
+    },
+    letter => {
+     string => $d->get('Letter'),
+     tooltip => $d->get(''),
+    },
+    legal => {
+     string  => $d->get('Legal'),
+     tooltip => $d->get(''),
+    },
+   },
+   default => 'none',
+  },
   'output-pages' => {
    type    => 'SpinButton',
    string  => $d->get('# Output pages'),
@@ -184,10 +203,11 @@
      tooltip => $d->get(
 'Vertical distance to keep from the sheet edge when aligning a border area.'
      ),
-     min   => 0,
-     max   => 1000,
-     step  => 1,
-     order => 0,
+     min     => -1000,
+     max     => 1000,
+     step    => 1,
+     order   => 0,
+     default => 0,
     },
     horizontal => {
      type    => 'SpinButton',
@@ -195,10 +215,11 @@
      tooltip => $d->get(
 'Horizontal distance to keep from the sheet edge when aligning a border area.'
      ),
-     min   => 0,
-     max   => 1000,
-     step  => 1,
-     order => 1,
+     min     => -1000,
+     max     => 1000,
+     step    => 1,
+     order   => 1,
+     default => 0,
     },
    },
   },
@@ -234,6 +255,7 @@
 
  # Layout ComboBox
  my $combobl  = $self->add_widget( $vbox, $options, 'layout' );
+ my $combobs  = $self->add_widget( $vbox, $options, 'sheet-size' );
  my $outpages = $self->add_widget( $vbox, $options, 'output-pages' );
  $combobl->signal_connect(
   changed => sub {
@@ -541,7 +563,9 @@
   }
   else {
    if ( defined $default->{$option} ) {
-    push @items, "--$option $default->{$option}";
+    if ( not $default->{$option} eq 'none' ) {
+     push @items, "--$option $default->{$option}";
+    }
    }
   }
  }

Reply via email to