Difference between revisions of "Ghostscript"

From ArchWiki
Jump to: navigation, search
m (Larivact moved page Ps2pdf to Ghostscript: content doesn't warrant article, expand scope)
(style)
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{lowercase title}}
 
 
[[Category:Office]]
 
[[Category:Office]]
 
[[es:Ps2pdf]]
 
[[es:Ps2pdf]]
{{Expansion|What is Ps2pdf, link official website.}}
+
[[Wikipedia:Ghostscript|Ghostscript]] is an interpreter for PostScript and PDF.
  
 
== Installation ==
 
== Installation ==
Line 8: Line 7:
 
[[Install]] the {{Pkg|ghostscript}} package.
 
[[Install]] the {{Pkg|ghostscript}} package.
  
== How do I create a PDF from PS the easy way? ==
+
== Usage ==
  
This page should help people who are asking themselves (maybe for the second, third or n-th time) this question and maybe found the answer once but never have written this somewhere or remembered correctly.
+
See {{man|1|gs}}.
  
== ps2pdf ==
+
=== ps2pdf ===
  
One command does it all:
+
''ps2pdf'' is a wrapper around ghostscript to convert PostScript to PDF:
ps2pdf -sPAPERSIZE=a4 -dOptimize=true -dEmbedAllFonts=true YourPSFile.ps
 
  
=== Explanation ===
+
$ ps2pdf -sPAPERSIZE=a4 -dOptimize=true -dEmbedAllFonts=true YourPSFile.ps
  
* ps2pdf is the wrapper to ghostscript (ps2pdf is owned by ghostscript package)
+
Explanation:
* with -sPAPERSIZE=something you define the paper size. Wondering about valid PAPERSIZE values? See [http://ghostscript.com/doc/current/Use.htm#Known_paper_sizes here]
 
* -dOptimize=true let's the created PDF be optimised for loading
 
* -dEmbedAllFonts=true makes the fonts look always nice
 
  
=== Misconceptions ===
+
* with {{ic|1=-sPAPERSIZE=something}} you define the paper size. For valid PAPERSIZE values, see [http://ghostscript.com/doc/current/Use.htm#Known_paper_sizes].
 +
* {{ic|1=-dOptimize=true}} let's the created PDF be optimised for loading
 +
* {{ic|1=-dEmbedAllFonts=true}} makes the fonts look always nice
  
* you cannot choose the paper orientation in ps2pdf. If your input PS file is healthy, it already contains the orientation information. If you are trying to use an Encapsulated PS file, you will have problems, if it does not fit in the -sPAPERSIZE you specified, because EPS files usually do not contain paper orientation informaiton. a workaround is creating a new paper in ghostscript settings (call it e.g. "slide") and use it as -sPAPERSIZE=slide
+
{{Note|You cannot choose the paper orientation in ps2pdf. If your input PS file is healthy, it already contains the orientation information. If you are trying to use an Encapsulated PS file, you will have problems, if it does not fit in the {{ic|1=-sPAPERSIZE}} you specified, because EPS files usually do not contain paper orientation informaiton. a workaround is creating a new paper in ghostscript settings (call it e.g. "slide") and use it as {{ic|1=-sPAPERSIZE=slide}}.}}
 +
 
 +
== See also ==
 +
 
 +
* [https://www.ghostscript.com/ Official website]

Revision as of 15:19, 11 October 2018

Ghostscript is an interpreter for PostScript and PDF.

Installation

Install the ghostscript package.

Usage

See gs(1).

ps2pdf

ps2pdf is a wrapper around ghostscript to convert PostScript to PDF:

$ ps2pdf -sPAPERSIZE=a4 -dOptimize=true -dEmbedAllFonts=true YourPSFile.ps

Explanation:

  • with -sPAPERSIZE=something you define the paper size. For valid PAPERSIZE values, see [1].
  • -dOptimize=true let's the created PDF be optimised for loading
  • -dEmbedAllFonts=true makes the fonts look always nice
Note: You cannot choose the paper orientation in ps2pdf. If your input PS file is healthy, it already contains the orientation information. If you are trying to use an Encapsulated PS file, you will have problems, if it does not fit in the -sPAPERSIZE you specified, because EPS files usually do not contain paper orientation informaiton. a workaround is creating a new paper in ghostscript settings (call it e.g. "slide") and use it as -sPAPERSIZE=slide.

See also