简体   繁体   中英

Linux enscript multiple text files to a single PostScript file

I'm using this code to create a text file from our application, convert it to PostScript using enscript and then convert it to PDF.

function print_order
{

  ORDERFORM="Sales Order"
  PARAMFILE="$1.par"

  echo "OUTPUT_TO:FILE:$1.tmp" > $PARAMFILE
  echo "DOCUMENT:$1" >> $PARAMFILE
  echo "FORM_NAME:$ORDERFORM" >> $PARAMFILE

  win_print_order /par:$PARAMFILE

  enscript $1.tmp -p $1.ps
  ps2pdf $1.ps

}

In it's current state it works by running print_order 900100 , this would create a 900100.pdf in the current directory.

But I am looking to be able to save multiple order prints in the same .pdf. Is it possible to pass multiple text files to enscript to create a single PostScript file of all order prints and from there a PDF?

For eg enscript $1.tmp,$2.tmp,$3.tmp -p $1.ps . Is this possible somehow?

Yes, enscript accepts multiple input files and outputs a single file. Try

enscript -p $1.ps $1.tmp $2.tmp $3.tmp

enscript accepts many options. See its man page .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM