Ghostscript命令實踐

來源:互聯網
上載者:User

標籤:

一、 將單張PDF檔案igs.pdf轉化為tiff檔案。

1. gs -sDEVICE=tiffg4 -sOutputFile=igs.tiff -dMaxStripSize=8192 igs.pdf

-dAdjustWidth=true|false (Boolean; default = true)

If true, then if the requested page width is close to either A4 (1728 columns) or B4 (2048 columns), set the page width to A4 or B4 respectively.

命令1. 自動產生的像素大小1728x2292

2. gs -q -r204x196 -g1728x2156 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=tiffg4 -sOutputFile=igs1.tiff -- igs.pdf

命令2. 手動指定了像素大小1728x2156

網上有說法:-r204x98 -g1728x1078 大小的檔案是標準的檔案?

注意!!!

經過測試,推薦使用1728x2292大小的設定,因為2156不能顯示完整的PDF頁首。

進一步查了一下,這個大小是標準的A4紙的解析度。

-r204x196 -g1728x2292 參數等同於 -sPAPERSIZE=a4。

3. gs -q -r204x196 -g1728x2156 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=tiffg3 -sOutputFile=igs2.tiff -- igs.pdf

命令2.和3.的區別:

輸出的fax壓縮格式不一樣,檔案的大小不一樣,此處測試檔案結果:igs1.tiff大小約為5Kb,而igs2.tiff為24Kb。

二、 將多張PDF檔案轉換為多張tiff檔案。

1. gs -q -r204x196 -g1728x2292 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=tiffg4 -sOutputFile=igs%d.tiff -- igs.pdf

命令1.產生的多張tiff檔案為igs1.tiff,igs2.tiff……

2. gs -q -r204x196 -g1728x2292 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=tiffg4 -sOutputFile=igs%02d.tiff -- igs.pdf

命令2.產生的多張tiff檔案為igs01.tiff,igs02.tiff……

Ghostscript命令實踐

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.