printer

Prin­ting with Gap (inner mar­gin)

under Linux



Printing Gap with Libreoffice

The simplest way to select a gap for printing is directly in Openoffice/Libreoffice. If you print in portrait orientation simply select Format→Page→Page→Layout settings→Page layout: mirrored and change Margins/Inner to be larger than the outer margin. For landscape orientation however this option only allows you to clamp on the shorter edge which may not be what you want. Nonetheless there is a trick on how you can print in landscape orientation and bind on the longer edge.

Go to 'Styles and Formatting' (first button in the shortcut bar on the very left), on 'Page Styles' (fourth button in the 'Styles and Formatting' sidebar which will appear on the right of your document.). 'Default' uses to be marked here as your default page style. Just double click on 'Right Page' for your first page. Double clicking sets the page style. Then again do right click on 'Right Page' to view the context menu and select 'Modify'. Got to the 'Organizer' tab and select as style for the next page ('Next Style') 'Left Page'. Proceed the same way for left pages: select 'Modify' in the context menu and then under 'Organizer', 'Next Style' 'Right Page'. That way you have made left and right pages alternate. Now you can select an individual left and right or inner and outer margin for each type of page respectively (Format→Page). For printing in landscape mode instead of using the default page styles 'Left Page' and 'Right Page' it would be more concise to create own page styles called 'Upper Page' and 'Lower Page' as described (select 'New' instead of 'Modify' in the context menu of 'Styles and Formatting').

Once you have created a page layout for printing in landscape mode it will be useful to save it as template. You can reuse the template every time you wanna create a document to be printed in landscape mode. Simply select File→Templates→Save whereby you should do this with an empty document.



Printing Postscript Documents (pdf) with Inner Margin

how to not do it: Things tend to get difficult under multiple operating systems whenever you receive a postscript document but need an inner margin or a gap in order to stitch the pages together. Simply selecting different page margins for even and odd pages under File→Print→Properties→Page in yourLinux printing dialogue does not achieve the desired result as the computer would have to scale the pages to a slimmer size in order to make place for the gap. If you do this the printer will simply cut off a certain part at the border of your pages also because most printers do not support printing up to the very edges of your paper sheets.

Whenever it comes to print multiple pages onto one while coincidently leaving an inner margin in order to stitch pages together later on your tool of choice will be 'bundsteg'. The tool uses pdfcrop to first remove all margins then scale the original page content to exactly the space being left over after subtracting the desired inner and outer margins. 'bundsteg' does not only qualify for leaving an inner margin but also for rotating individual pages and page ranges if your document should ever make this necessary. Always specify whether the resulting page should be oriented horizontally ('landscape') or vertically. You may give different margins for even and odd pages. Have a look at --help to see for more options like (--frame) for drawing a frame around each slide. Don`t forget to install the packages texlive-extra-utils, pdftk and poppler-utils if you want to tap the full power of the tool.


donate

Downloads:
bund­steg bash­script (v1.2) fixed version with many new features (2015-04-19), ** recom­mended **
bund­steg bash­script (v1.1) no dependency on non-OSS pdftools any more; deprecated intermediate version (2015-04-13)
bund­steg bash­script (v1.0) initial version from 2009-08-05
Beispiele:
test.pdf (initial docu­ment) test-full.pdf
test-1x2.pdf test-2x2.pdf
test-1x2-frame-alter­nating.pdf rotated.pdf, unrotated.pdf
Epistel:
elws@elstel.org
SHA512SUMS:
software/SHA512SUMS.signed

Please sign our Contributor License Agreement if you want to contribute code. Otherwise we can not assimilate and re-distribute your changes here at elstel.org



elm:~/bundsteg> chmod +x ./bundsteg
elm:~/bundsteg>  ./bundsteg --help
bundsteg [opts] --horiz bs[,bs2] input.pdf [output.pdf]
bundsteg [opts] --vert bs[,bs2] input.pdf [output.pdf]
  bs: size of gutter in mm (or the unit specified by --mm/--inch/--zoll); use f.i. 10 or 15
  you may specify a different gutter size for even pages (bs2) separated by a colon from the one for odd pages
  default output file: input.bundsteg.pdf
[opts]: -v/--verbose/-vv: be more verbose, -q/--quiet: be quiet
        --a4 (default) / --a4+ / --letter / --legal
        --mm (default) / --inch = --zoll 
        --rl/rr/rd ~1 / 2,3-4 ... rotate all pages / pages 2,3-4 left, right or double (twice)
        --rr 7-18~3:1 ... rotate pages between 7 and 18 with modulo 3 = 1
        --nup 2x1 ..... fold 2x1 input pages onto one output page
        --frame ..... draw a frame around each page, --align-bottom / --align-top
        --margin 4.2[,4.2[,4.2[,4.2]]] ... specify minimum margins (left,top,right,bottom)
        --[no-]nup-crop ... crop margins before nup; default is currently off because of an 
                            incompatibilty between pdfnup and pdfcrop.

see also: bundsteg --license / --help 

elm:~/bundsteg> ./bundsteg --nup 1x2 --vert 10 aifr.pdf aifr-1x2.pdf 
pdfjam/pdfnup --nup 1x2 --no-landscape --frame false --outfile /tmp/tmp.ZGnx6RYsEr_nup.pdf 'aifr.pdf'
 even pages: removing margins </tmp/tmp.9SnhXWHx4l_even.pdf >/tmp/tmp.U8HI1SDNnW_even-mg.pdf
 odd pages: removing margins </tmp/tmp.QTv9kPyHuh_odd.pdf >/tmp/tmp.tJbFinmiCj_odd-mg.pdf
 odd pages: re-adding margins </tmp/tmp.tJbFinmiCj_odd-mg.pdf >/tmp/tmp.PXzfchCRGr_odd-bs.pdf
 even pages: re-adding margins </tmp/tmp.U8HI1SDNnW_even-mg.pdf >/tmp/tmp.bhxg0PjnIV_even-bs.pdf
combining odd and even pages.

elm:~/bundsteg> ./bundsteg --nup 1x2 --frame --vert 14,4 aifr.pdf aifr-1x2-frame-alternating.pdf 
pdfjam/pdfnup --nup 1x2 --no-landscape --frame true --outfile /tmp/tmp.gPFfczNXNL_nup.pdf 'aifr.pdf'
 even pages: removing margins </tmp/tmp.nUz81Ql70p_even.pdf >/tmp/tmp.istkfpQP97_even-mg.pdf
 odd pages: removing margins </tmp/tmp.qQTsOdWUc9_odd.pdf >/tmp/tmp.CYhWvCkFHz_odd-mg.pdf
 even pages: re-adding margins </tmp/tmp.istkfpQP97_even-mg.pdf >/tmp/tmp.ZpnZD2ONHh_even-bs.pdf
 odd pages: re-adding margins </tmp/tmp.CYhWvCkFHz_odd-mg.pdf >/tmp/tmp.sXok5DUldu_odd-bs.pdf
combining odd and even pages.

elm:~/bundsteg> ./bundsteg --horiz 15 aifr.pdf aifr-full.pdf 
 even pages: removing margins </tmp/tmp.ZGs1Mr4a3K_even.pdf >/tmp/tmp.DoOv5ShD4h_even-mg.pdf
 odd pages: removing margins </tmp/tmp.NLiAcwgen5_odd.pdf >/tmp/tmp.lVYUiMx0Zz_odd-mg.pdf
 even pages: re-adding margins </tmp/tmp.DoOv5ShD4h_even-mg.pdf >/tmp/tmp.cxEFmKWQ4y_even-bs.pdf
 odd pages: re-adding margins </tmp/tmp.lVYUiMx0Zz_odd-mg.pdf >/tmp/tmp.uU3bWRX0Iz_odd-bs.pdf
combining odd and even pages.

elm:~/bundsteg> ./bundsteg -v --rl 2 --rd 3-4 --rr 5 --horiz 0 rotated.pdf unrotated.pdf 
splitting odd and even pages.
odd: P1 P3D P5R 
even: P2L P4D 

 odd pages: removing margins </tmp/tmp.21jdcK7gy8_odd.pdf >/tmp/tmp.0ycipvVzaS_odd-mg.pdf
==> 3 pages written on `/tmp/tmp.0ycipvVzaS_odd-mg.pdf'.

 odd pages: re-adding margins </tmp/tmp.0ycipvVzaS_odd-mg.pdf >/tmp/tmp.NfoZjyoC5K_odd-bs.pdf

 even pages: removing margins </tmp/tmp.wRh5RYLHsd_even.pdf >/tmp/tmp.Lgym20XhlX_even-mg.pdf
==> 2 pages written on `/tmp/tmp.Lgym20XhlX_even-mg.pdf'.

 even pages: re-adding margins </tmp/tmp.Lgym20XhlX_even-mg.pdf >/tmp/tmp.r4H3hF9eu8_even-bs.pdf

combining odd and even pages.


elm:~/bundsteg> ./bundsteg -vv --nup 2x2 --horiz 12 aifr.pdf aifr-2x2.pdf 

xext=841.88976377 yext=595.27559055
xextodd=818.07874015 (11.90551181 45.92125973 11.90551181 11.90551181) yextodd=537.44881901
xexteven=818.07874015 (11.90551181 11.90551181 11.90551181 45.92125973) yexteven=537.44881901
pdfjam/pdfnup --nup 2x2 --landscape --frame false --outfile /tmp/tmp.oMmiPdQ2nU_nup.pdf 'aifr.pdf'
          ----
  pdfjam: This is pdfjam version 2.08.
  pdfjam: Reading any site-wide or user-specific defaults...
          (none found)
  pdfjam: Effective call for this run of pdfjam:
          /usr/bin/pdfjam --nup '2x2' --landscape --frame 'false' --outfile /tmp/tmp.oMmiPdQ2nU_nup.pdf -- aifr.pdf - 
  pdfjam: Calling pdflatex...
  pdfjam: Finished.  Output was to '/tmp/tmp.oMmiPdQ2nU_nup.pdf'.

splitting odd and even pages.
odd: P1 P3 P5 P7 P9 P11 P13 P15 P17 
even: P2 P4 P6 P8 P10 P12 P14 P16 
---------------------------------------------------------------------------

Creator:        pdftk 1.44 - www.pdftk.com
Producer:       itext-paulo-155 (itextpdf.sf.net-lowagie.com)
CreationDate:   Sun Apr 19 18:15:00 2015
ModDate:        Sun Apr 19 18:15:00 2015
Tagged:         no
Pages:          9
Encrypted:      no
Page size:      841.89 x 595.276 pts (A4)
File size:      361484 bytes
Optimized:      no
PDF version:    1.4

 odd pages: removing margins </tmp/tmp.xhcyMmM3bP_odd.pdf >/tmp/tmp.wkVE655t5a_odd-mg.pdf
==> 9 pages written on `/tmp/tmp.wkVE655t5a_odd-mg.pdf'.
782 x 559
Creator:        TeX
Producer:       pdfTeX-1.40.13
CreationDate:   Sun Apr 19 18:15:04 2015
ModDate:        Sun Apr 19 18:15:04 2015
Tagged:         no
Pages:          9
Encrypted:      no
Page size:      782 x 559 pts
File size:      1070573 bytes
Optimized:      no
PDF version:    1.4
scalodd=.96144690 addxodd=33.61363217 addyodd=.50000095 liodd=45.51914398 unodd=12.40551276 obodd=46.42126068

 odd pages: re-adding margins </tmp/tmp.wkVE655t5a_odd-mg.pdf >/tmp/tmp.J1sMqvwykw_odd-bs.pdf
page heights (+dup last): 559 558 559 559 559 559 559 559 559 559
Producer:       GPL Ghostscript 9.05
CreationDate:   Sun Apr 19 18:15:04 2015
ModDate:        Sun Apr 19 18:15:04 2015
Tagged:         no
Pages:          9
Encrypted:      no
Page size:      841.89 x 595.28 pts (A4)
File size:      484160 bytes
Optimized:      no
PDF version:    1.4

---------------------------------------------------------------------------

Creator:        pdftk 1.44 - www.pdftk.com
Producer:       itext-paulo-155 (itextpdf.sf.net-lowagie.com)
CreationDate:   Sun Apr 19 18:15:00 2015
ModDate:        Sun Apr 19 18:15:00 2015
Tagged:         no
Pages:          8
Encrypted:      no
Page size:      841.89 x 595.276 pts (A4)
File size:      294835 bytes
Optimized:      no
PDF version:    1.4

 even pages: removing margins </tmp/tmp.06UULZNFb4_even.pdf >/tmp/tmp.DxD3CKb1Ro_even-mg.pdf
==> 8 pages written on `/tmp/tmp.DxD3CKb1Ro_even-mg.pdf'.
782 x 559
Creator:        TeX
Producer:       pdfTeX-1.40.13
CreationDate:   Sun Apr 19 18:15:09 2015
ModDate:        Sun Apr 19 18:15:09 2015
Tagged:         no
Pages:          8
Encrypted:      no
Page size:      782 x 559 pts
File size:      933873 bytes
Optimized:      no
PDF version:    1.4
scaleven=.96144690 addxeven=33.61363217 addyeven=.50000095 lieven=45.51914398 uneven=46.42126068 obeven=12.40551276

 even pages: re-adding margins </tmp/tmp.DxD3CKb1Ro_even-mg.pdf >/tmp/tmp.uoQTG4BXgT_even-bs.pdf
page heights (+dup last): 559 559 559 559 559 559 559 559 559
Producer:       GPL Ghostscript 9.05
CreationDate:   Sun Apr 19 18:15:09 2015
ModDate:        Sun Apr 19 18:15:09 2015
Tagged:         no
Pages:          8
Encrypted:      no
Page size:      841.89 x 595.28 pts (A4)
File size:      446786 bytes
Optimized:      no
PDF version:    1.4

---------------------------------------------------------------------------


 pdftk E=/tmp/tmp.uoQTG4BXgT_even-bs.pdf O=/tmp/tmp.J1sMqvwykw_odd-bs.pdf cat O1 E1 O2 E2 O3 E3 O4 E4 O5 E5 O6 E6 O7 E7 O8 E8 O9  output "aifr-4x2.pdf"