Willkommen, Gast ( Anmelden | Registrierung )
Suche · Mitglieder · Kalender · Hilfe · Windows 7 Special
   
  Informationen
 

Zuständiger Moderator: Witi

Anzeige
Script Zum A5 Broschüre / Booklet Ausdrucken
Zusätzlich zu den Tipps unten hilft eventuell ein Registry-Scan: Nervige Windows-Fehler lassen sich oft mit einem Aufräumen der Windows Registry beheben. In der Regel läuft und startet Windows danach auch wieder schneller!
Gratis System-Scan jetzt starten
 
Reply to this topicStart new topic
  Script Zum A5 Broschüre / Booklet Ausdrucken
 
> Script Zum A5 Broschüre / Booklet Ausdrucken
Fenix
Beitrag 19.01.2009, 22:47
Beitrag #1


Gruppensymbol

alter Hase
Beiträge: 241
Beigetreten: 18.03.2004
Wohnort: nrw




Hi,
anbei ein kleines Script, das normale PDF Dateien so umwandelt, dass man sie als Din A5 Broschüren drucken kann.
Man braucht dazu:
pdftops aus xpdf,
pstops aus psutils,
ps2pdf aus ghostscript

Bedienung:
./scriptname dateiname.pdf simplex
-> erstellt aus dateiname.pdf eine Datei dateiname-front.pdf mit den Vorderseiten der Blätter und eine Datei dateiname-back.pdf mit den Rückseiten. Die PDFs können dann getrennt ausgedruckt werden und man kann für Drucker ohne Duplex per Hand zwischendurch umsortieren.
./scriptname dateiname.pdf duplex
-> erstellt aus dateiname.pdf eine Datei dateiname-duplex.pdf, die die PDF passend als A5 Broschüre beinhaltet.

QUELLTEXT
#!/bin/bash

#
# Copyright (c) 2009, Jan Bessai
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#     * Neither the name of Jan Bessai nor the
#       names of its contributors may be used to endorse or promote products
#       derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY Jan Bessai ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Jan Bessai BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#


FILE=`basename $1 .pdf`
FILEPS="$FILE.ps"

if [[ -z "$1" || -z "$2" || ( "$2" != "duplex" && "$2" != "simplex" ) ]]
then
    echo "usage: $0 filename mode" >&2
    echo "where mode is duplex or simplex" >&2
    exit -1
elif [[ ! -e $1 || ! -r $1 ]]
then
    echo "error: cannot read $FILE" >&2
    exit -1
elif [ $2 = "duplex" ]
then
    FILEDUPLEXPS="$FILE-duplex.ps"
    FILEDUPLEX="$FILE-duplex.pdf"

    if [[ -e $FILEPS || -e $FILEDUPLEXPS || -e $FILEDUPLEX ]]
    then
        echo "error: Make sure $FILEPS $FILEDUPLEXPS and $FILEDUPLEX are not existing!" >&2
        exit -1
    else

        pdftops -paper A4 $1 $FILEPS
        pstops -pa4 "4:-3L@.7(21cm,0)+0L@.7(21cm,14.85cm),1L@.7(21cm,0)+-2L@.7(21cm,14.85cm)" $FILEPS $FILEDUPLEXPS
        ps2pdf -sPAPERSIZE=a4 $FILEDUPLEXPS $FILEDUPLEX

        rm -f $FILEPS
        rm -f $FILEDUPLEXPS
    fi    
    exit 0
elif [ $2 = "simplex" ]
then
    FILEFRONTPS="$FILE-front.ps"
    FILEFRONT="$FILE-front.pdf"
    FILEBACKPS="$FILE-back.ps"
    FILEBACK="$FILE-back.pdf"

    if [[ -e $FILEPS || -e $FILEFRONTPS || -e $FILEBACKPS || -e $FILEFRONT || -e $FILEBACK ]]
    then
        echo "error: Make sure $FILEPS $FILEFRONTPS $FILEBACKPS $FILEFRONT and $FILEBACK are not existing!" >&2
        exit -1
    else
        pdftops -paper A4 $1 $FILEPS

        pstops -pa4 "4:-3L@.7(21cm,0)+0L@.7(21cm,14.85cm)" $FILEPS $FILEFRONTPS
        pstops -pa4 "4:1L@.7(21cm,0)+-2L@.7(21cm,14.85cm)" $FILEPS $FILEBACKPS

        ps2pdf -sPAPERSIZE=a4 $FILEFRONTPS $FILEFRONT
        ps2pdf -sPAPERSIZE=a4 $FILEBACKPS $FILEBACK
        
        rm -f $FILEPS
        rm -f $FILEFRONTPS
        rm -f $FILEBACKPS
    fi

    exit 0
fi


Viel Erfolg und Spaß damit smile.gif

Gruß,
Fenix




--------------------
QUELLTEXT
xor Fenix, Fenix
xor place, place
mov place, Fenix
Profile Card PM Email Poster +ZitierenGo to the top of the page
Maten
Beitrag 19.03.2010, 14:21
Beitrag #2


Gruppensymbol

Junior
Beiträge: 1
Beigetreten: 19.03.2010




Die Idee is ja gut, den Prozess zur fertigen A5 Broschüre zu erleichtern - doch leichter wird es allerdings ohne eigene Tools auf der Festplatte.

Der Trick ist simpel wie einfach: Viele online Druckereien bieten online Tools, die Word automatisch passend konvertieren. Einfach hochladen, das Word Dokument passend konvertieren lassen (Beispiel A5 Broschüre) und dann die Vorlage wieder herunterladen. fertig. Tipps dazu findet Ihr hier: http://www.broschueren-drucken-guenstig.de ! Mit PDF und Powerpoint funktioniert das Spiel im Übrigen auch. Einfach hochladen, in die gewünschte Broschüre umwandeln und dann einfach drucken - ohne viele Tools auf dem eigenen Rechner installieren zu müssen.


mfg

Der Beitrag wurde von Maten bearbeitet: 19.03.2010, 14:22
Profile Card PM +ZitierenGo to the top of the page
Reply to this topicStart new topic
1 Besucher lesen dieses Thema (Gäste: 1 | Anonyme Besucher: 0)
0 Mitglieder:
 
Haftungshinweis

RSS Vereinfachte Darstellung Aktuelles Datum: 30.07.2010, 18:13