How to merge two postscript files together?

后端 未结 6 1854
春和景丽
春和景丽 2020-12-09 06:59

I am trying to merge two or more postscript files into one. I tried concatenation but it does not work as each postscript file may have different resource header.

Ha

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 07:06

    As OP mentioned in the question's conclusions, concatenating the files with the line

    false 0 startjob pop
    

    in between should do the trick. So in bash, one could write something like

    mkdir merge
    for ps in *.ps; do
        cat $ps >> merge/output.ps
        echo "false 0 startjob pop" >> merge/output.ps
    done
    

    However, as the question also mentions this is only useful for printing (or PDF conversion), a viewer will probably fail to display all but the first ps file. Some more details can be found here.

提交回复
热议问题