pdf Merge your Postscript file with Sed and Awk
Par keyphrene, Friday 26 June 2009 à 09:42 :: Shell Unix :: #19 :: rss
When you wish merge your Postscript files via cat command, some printers break printing after the first page. This shell script sanitize your postscript file after merge with cat command in three steps.
- Get file header
- Get all pages between %%Page: and %%PageTrailer
- Add footer %%Trailer
FILEPS=file.ps FILEMERGE=file_merge.ps # Merge your postscript files cat file1.ps file2.ps file3.ps > $FILEPS # Sanitize your Poscript file sed '/^%%Page:/,$d' $FILEPS > $FILEMERGE awk '/%%Page:/,/%%PageTrailer/' $FILEPS >> $FILEMERGE echo -e '%%Trailer\n%%EOF' >> $FILEMERGE

Comments
No comment for this moment.
Add a comment