On Sat 18 Jan 2020 at 15:42:08 (+0100), Rainer Dorsch wrote:
> Hi,
> 
> I have a pdf file with a page size of 186x65 mm2. If I print that on A4, I 
> get 
> printouts which are mainly white, except the 186x65 mm2.
> 
> Is there a good way to get it printed in a compact way (e.g. 4 pages on top 
> of 
> each other on an A4 sheet)? I could not find an option in pdftk, so any 
> advice 
> or hint is welcome...

I use pdfjam in texlive-extra-utils in functions like these.

function a4-2up-a4r {
    [ -z "$1" ] && printf '%s\n' "Usage:        $FUNCNAME prints a single A4 
page as 2-up A5 pages on an
        A4 landscape page for producing A5 hand bills when cut up." >&2 && 
return 1
    local Expandedname="$(-addextensionandoldfile "$1" "pdf")"
    [ -z "$Expandedname" ] && return
    pdfjam --vanilla --nup '2x1' --landscape --a4paper --outfile 
"${Expandedname/%.pdf/-a4-2up-a4r.pdf}" "$Expandedname" "$Expandedname"
}

function a4-4up-a4 {
    [ -z "$1" ] && printf '%s\n' "Usage:        $FUNCNAME prints a single A4 
page as 4-up A6 pages on an
        A4 page for producing A6 hand bills when cut up." >&2 && return 1
    local Expandedname="$(-addextensionandoldfile "$1" "pdf")"
    [ -z "$Expandedname" ] && return
    pdfjam --vanilla --nup '2x2' --no-landscape --a4paper --outfile 
"${Expandedname/%.pdf/-a4-4up-a4.pdf}" "$Expandedname" "$Expandedname" 
"$Expandedname" "$Expandedname"
}

function a4-8up-a4r {
    [ -z "$1" ] && printf '%s\n' "Usage:        $FUNCNAME prints a single A4 
page as 8-up A7 pages on an
        A4 page for producing A7 tickets when cut up." >&2 && return 1
    local Expandedname="$(-addextensionandoldfile "$1" "pdf")"
    [ -z "$Expandedname" ] && return
    pdfjam --vanilla --nup '4x2' --landscape --a4paper --outfile 
"${Expandedname/%.pdf/-a4-8up-a4r.pdf}" "$Expandedname" "$Expandedname" 
"$Expandedname" "$Expandedname" "$Expandedname" "$Expandedname" "$Expandedname" 
"$Expandedname"
}

-addextensionandoldfile just adds .pdf if absent, and checks the file
exists. Then the output file has explanatory info added to its name.

The pages are prepared for purpose at the appropriate size. You can
use   --scale n   and   --noautoscale true   if needed for your input.

Cheers,
David.

Reply via email to