Category Archives: Ghostscript

Ghostscript – first 10 steps .

Today tutorial it’s about Ghostscript under Windows 10 OS.
Ghostscript was originally written by L. Peter Deutsch for the GNU Project, and released under the GNU General Public License in 1986. This means it has been under active development for over 20 years. Also the Ghostscript has been ported to many different systems during this time.
Download it from here and the install it.
gs918w64_001
gs918w64_002
I used this version:gs918w64.
You can use the tree windows command to see the folders of this instalation.

Under bin folder you can see some files.
Add also under Windows system variable, this will help deal with Ghostscript and GIMP application.
gs918w64c_installation_path
The most important files come with:
GSWIN64C.EXE – this is usually the preferred executable Ghostscript as a 64-bit Windows command line program;
GSWIN64.EXE – this is a 64-bit Ghostscript using its own window for commands;
GSDLL64.DLL – the 64-bit dynamic link library containing most of Ghostscript’s functionality;

Also you can use and will see two windows for you.
One will help you to write your ghostscripts and another to see the result.
gs918w64_003
If you want to used the Ghostscript the you need to go to bin folder and use like commands.
For example:

I used LibreOffice to make one test pdf file and I named : my_test_forest.pdf.
I save this pdf file under bin folder and I make first tests.
gs918w64_004
1. using Ghostscript to convert file formats from PDF to JPEGs.

– this will convert your pdf file like multiple images: -sOutputFile=test-%d.jpeg;
– the input file is my pdf test file: my_test_forest.pdf;
2. see a brief help message with -h or -? ;

– this will open one window to see the brief message
3. select b3 paper size

– Ghostscript is configured to use U.S. letter paper as default page size, so you can change it with -sPAPERSIZE=b3;
– if you want to use a4 the just put this command-line argument: -sPAPERSIZE=a4;
4. How to get a list of available printer devices using gswin64c.exe and devicenames ==

– this output can be used with -sDEVICE= argument;
5. make and run one script with Ghostscript
– create one file and named test.ps then add this:

– run this command:

– the output will be like this:
gs918w64_006
– this %! will start the script;
– the next line: the … 32 scalefont setfont will find and set the Helvetica font;
– the next step moves the current point from the left and bottom edges of the page;
– the fourth line draws the text into the page bitmap at the current point;
– the last line of script display the result;
6. another way to run your scripts
– just use your name script and run command like this:

– the test.ps it’s the name of my script I make it;
7. make a shape with
– this will make one triangle;

– create path , make lines close path and show outline;
– you can also use: showpage to print everything;
8. difficulties of learning stack can be solve with this simple example:
– I start gswin64c and then I type this: 2 7 8 stack = = = stack

– you can see how stack is upload with numbers the show us with stack and =
9. combine several input pdf files into one
– just add your pdf files on input;
– set the output pdf, in this case all.pdf

– you can use many type of your file: .pdf, .eps, .ps;
10. quit to close Ghostscript.
– just type quit, like this:

I will come with examples and tutorials about Ghostscript under Windows 10 and Linux OS.

Posted in All, Ghostscript. Tagged with , , , , , .