所以我想添加一個「footer」(歸屬)到我通過postscript與groff在linux中生成的pdf文件的每一頁的底部。我使用ps2pdf工具將文件從ps轉換爲pdf,因此我可以訪問這兩種格式。如何在Linux中的postscript或pdf文件的每個頁面的底部添加頁腳?
這兩個職位已經有點幫助:
How to add page numbers to Postscript/PDF
How can I make a program overlay text on a postscript file?
我不反對使用第一種方法,但我沒有獲得在提到pdflatex
工具第一個腳本,我也沒有選擇將它安裝在需要完成工作的機器上。
它看起來像第二種方法可能工作,但我已安裝ghostscript版本8.15,我沒有看到手冊頁上列出的許多標誌(http://unix.browserdebug.com/man/gs/)。我想我可以使用「-c」標誌插入一些postscript代碼,即使它沒有列出。總之,這裏有兩個命令我曾嘗試:
gs -o output.pdf -sDEVICE=pdfwrite -g5030x5320 \ -c "/Helvetica-Italic findfont 15 scalefont setfont 453 482 moveto (test-string) show" \ -f input.ps
,讓我:
Unknown switch -o - ignoring ESP Ghostscript 815.02 (2006-04-19) Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. ERROR: /undefinedfilename in (output.pdf) Operand stack: Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push Dictionary stack: --dict:1117/1686(ro)(G)-- --dict:0/20(G)-- --dict:102/200(L)-- Current allocation mode is local Last OS error: 2 ESP Ghostscript 815.02: Unrecoverable error, exit code 1
所以很明顯-o標誌有問題,所以我做了一些研究,並試圖語法如下:
gs -sOUTPUTFILE=output.pdf -sDEVICE=pdfwrite -g5030x5320 \ -c "/Helvetica-Italic findfont 15 scalefont setfont 453 482 moveto (test-string) show" \ -f input.ps
它輸出這一點,讓我回車4倍(也許有在input.ps 4頁)
ESP Ghostscript 815.02 (2006-04-19) Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Can't find (or can't open) font file /usr/share/ghostscript/8.15/Resource/Font/Helvetica-Italic. Can't find (or can't open) font file Helvetica-Italic. Querying operating system for font files... Didn't find this font on the system! Substituting font Helvetica-Oblique for Helvetica-Italic. Loading NimbusSanL-ReguItal font from /usr/share/fonts/default/Type1/n019023l.pfb... 3742416 2168114 2083056 759694 1 done. Loading NimbusRomNo9L-ReguItal font from /usr/share/fonts/default/Type1/n021023l.pfb... 3781760 2362033 2365632 1015713 1 done. Loading NimbusRomNo9L-Medi font from /usr/share/fonts/default/Type1/n021004l.pfb... 3865136 2547267 2365632 1029818 1 done. Loading NimbusRomNo9L-Regu font from /usr/share/fonts/default/Type1/n021003l.pfb... 4089592 2759001 2365632 1032885 1 done. Using NimbusRomanNo9L-Regu font for NimbusRomNo9L-Regu. >>showpage, press <return> to continue<< >>showpage, press <return> to continue<< >>showpage, press <return> to continue<< >>showpage, press <return> to continue<<
所以它看起來像這將是足夠簡單易用gs
簡單地插入一個PS文件的東西,但它被證明是相當複雜的...
我正在使用ESP安裝的系統,沒有安裝升級版本的權限。我想知道是否有辦法讓它與ESP一起工作... – cwd 2011-02-05 06:59:31
ESP Ghostscript不再維護....要使它成爲非特權用戶的唯一方法是另外安裝更新的版本Ghostscript到您的主目錄(或任何其他地方可由您的帳戶寫入)。 – 2011-02-12 11:04:55