For other information, see the Ghostscript overview. You may also be interested in how to build Ghostscript and install itas well as the description of the driver interface.
Documentation for some older, superceded devices has been moved to another document. In general such devices are deprecated and will be removed in future versions of Ghostscript.
In general all older printer drivers can be replaced by the ijs interface and one of the available 3rd party raster driver collections. We recommend moving to the ijs device for all such printing. Several different important kinds of measures appear throughout this document: inches, centimeters and millimeters, points, and bits per pixel.
Centimeters and millimeters ISO standard paper sizes such as A4 and A3 are commonly represented in the SI units of centimeters and millimeters. Centimeters are abbreviated cmmillimeters mm. Inches 1 inch equals 2. The inch measure is sometimes represented by in or a quotation mark " to the right of a measure, like 8.
See in the usage documentation all the paper sizes predefined in Ghostscript. Points Points are a measure traditionally used in the printing trade and now in PostScript, which specifies exactly 72 points per inch approximately Dots per inch Dots per inch or dpi is the common measure of printing resolution in the US. Bits per pixel Commonly abbreviated bpp this is the number of digital bits used to represent the color of each pixel.
This is also referred to as 'bit depth' or 'pixel depth'. Image file formats Ghostscript supports output to a variety of image file formats and is widely used for rasterizing postscript and pdf files. A collection of such formats 'output devices' in Ghostscript terminology are described in this section. Here are some commonly useful driver options that apply to all raster drivers. Options specific to particular file formats are described in their respective sections below. This is a general option telling Ghostscript what to name the output.
It can either be a single filename ' tiger. This option sets the resolution of the output file in dots per inch. The default value if you don't specify this options is usually 72 dpi. These options control the use of subsample antialiasing.
Their use is highly recommended for producing high quality rasterizations of the input files. The size of the subsampling box n should be 4 for optimum output, but smaller values can be used for faster rendering. Antialiasing is enabled separately for text and graphics content. Because this feature relies upon rendering the input it is incompatible, and will generate an error on attempted use, with any of the vector output devices. These suppress interactive prompts and enable some security checks on the file to be run.
Please see the Use documentation for a complete description. PNG pronounced 'ping' stands for Portable Network Graphics, and is the recommended format for high-quality images. It supports full quality color and transparency, offers excellent lossless compression of the image data, and is widely supported. Please see the PNG website for a complete description of the format. Ghostscript provides a variety of devices for PNG output varying by bit depth. For normal use we recommend png16m for bit RGB color, or pnggray for grayscale.
The pngpng16 and pngmono devices respectively provide 8-bit color, 4-bit color and black-and-white for special needs. The pngmonod device is also a black-and-white device, but the output is formed from an internal 8 bit grayscale rendering which is then error diffused and converted down to 1bpp.For other information, see the Ghostscript overview.
Overview High level devices are Ghostscript output devices which do not render to a raster, in general they produce 'vector' as opposed to bitmap output. Such devices currently include; pdfwrite, ps2write, eps2write, txtwrite, xpswrite, pxlmono and pxlcolor. Although these devices produce output which is not a raster, they still work in the same general fashion as all Ghostscript devices.
The device decides whether to handle the primitive itself, or call upon the graphics library to render the primitive to the final raster. Primitives are quite low level graphics operations; as an example consider the PDF sequence '0 0 re f'. This contrstructs a rectangle with the bottom left corner at 0,0 whcih is units wide by units high, and fills it with the current color.
A lower level implementation using only primitives would first move the current point to 0,0, then construct a line to 0, then a line toa line to0 and finally a line back to 0,0. It would then fill the result.
Now the raster devices all call the graphcs library to process primitives though they may choose to take some action first and render the result to a bitmap. The high level devices instead reassemble the primitives back into high level page description and write the result to a file.
This means that the output, while it should be visually the same as the input because it makes the same marksis not the same as the original input, even if the output Page Description Language is the same as the input one was eg PDF to PDF. Why is ths important? Firstly because the description of the page won't be the same, if your worflow relies upon for example finding rectangles in the description then it might not work after it has been processed by a high level device, as the rectangles may all have turned into lengthy path descriptions.
In addition, any part of the original input which does not actually make marks on the page such as hyperlinks, bookmarks, comments etc will normally not be present in the output, even if the output is the same format. In general the PDF interpreter and the PDF output device pdfwrite try to preserve the non-marking information from the input, but some kinds of content are not carrried across, in particular comments are not preserved.
Instead a new PDF file is being created, which should look the same as the original, but the actual insides of the PDF file are not the same as the original. Ths may not be a problem, but if its important to keep the original contents, then you need to use a different tool we'd suggest MuPDF, also available from Artifex. Of course, if the intention is to produce a modified PDF file for example, reducing the resolution of images, or changing the colour spacethen clearly you cannot keep the original contents unchanged, and pdfwrite performs these tasks well.
Text output The txtwrite device will output the text contained in the original document as Unicode.how to rotate pdf and save changes in adobe reader
The XML output is the same format as the MuPDF output, but no additional processing is performed on the content, so no block detection. Note the alogrithm used is not the same as the MuPDF code, and so the results will not be identical. There are a number of caveats as mentioned in the overview above. In adition the general comments there are some additional points that bear mentioning.
The pdfwrite device makes no attempt to handle thse, and the resulting PDF file will not match the original input. The only way to deal with these types of file is to render the whole page to a bitmap and then 'wrap' the bitmap as a PDF file. Currently we do not do this either, but it is possible that a future enhancement may do so. If the input contains PDF-compatible transparency, but the ps2weite device is selected, or the pdfwrite device is selected, but has been told to limit the PDF feature set to a version less than 1.
In this case the entire page is rendered to a bitmap and that bitmap is 'wrapped up' in appropriate PDF or PostScript content. The output should be visually the same as the input, but since it has been rendered it will not scale up or down well, unlike the original, vector, content of the input. The options in the command line may include any switches that may be used with the language interpreter appropriate for the input see here for a complete list.
In addition the following options are common to all the pdfwrite family of devices, and should work when specified on the comand line with any of the language interpreters.
By setting this flag, forms will be unrolled and stored in the output each time they are used, which avoids the problems.For other information, see the Ghostscript overview and, if necessary, how to install Ghostscript. This document describes how to use the command line Ghostscript client.
Ghostscript is also used as a general engine inside other applications for viewing files for example. Please refer to the documentation for those applications for using Ghostscript in other contexts.
Oh no! Some styles failed to load. 😵
The command line to invoke Ghostscript is essentially the same on all systems, although the name of the executable program itself may differ among systems. For instance, to invoke Ghostscript on unix-like systems type:. There are other utility scripts besides ps2pdfincluding pdf2psps2epsipdf2dscps2asciips2ps and ps2ps2. These just call Ghostscript with the appropriate if complicated set of options. You can use the 'ps2' set with eps files.
The interpreter reads and executes the files in sequence, using the method described under " File searching " to find them. The interpreter runs in interactive mode by default. After processing the files given on the command line if any it reads further lines of PostScript language commands from the primary input stream, normally the keyboard, interpreting each line separately.
To quit the interpreter, type " quit ". The interpreter also quits gracefully if it encounters end-of-file or control-C. The interpreter recognizes many options. An option may appear anywhere in the command line, and applies to all files named after it on the line. The most important are described in detail here. Please see the reference sections on options and devices for a more complete listing.
You can get a brief help message by invoking Ghostscript with the -h or -? On Windows, the two digit number indicates the word length of the system for which the binary was built so gswin And the "c" suffix indicates a Windows console based binary note that the "display device" window will still appear.
Selecting an output device Ghostscript has a notion of 'output devices' which handle saving or displaying the results in a particular format.Hi, I am trying to rotate a pdf document of 10 pages in landascape A3 format, in order to get an A3 portrait. My final goal is to get 10 separate tiff images in portrait, in order to use them as input files for an OCR software.
You could even do it in one step. I tend to generate a text file with the parameters on single lines then call GS using the directive to treat the file as a parameter list. Setting the page size on the ghostscript command line doesn't help, because it will be overriden. This sets the page size to A3, and then says it is the only available page size, and that ghostscript should attempt to make it fit on that page rotating if needed.
Help Create Join Login. Operations Management. IT Management. Project Management. Services Business VoIP. Resources Blog Articles Deals. Menu Help Create Join Login. Home Browse Ghostscript Discussion. Ghostscript Brought to you by: cliddellmilesjonesrayjj. Forum: Help. Creator: afylot. Created: Updated: I don't know how to accomplish the first one. How can I transform this pdf from landscape to portrait? Thank you.
When I scan documents that are landscape oriented, the output PDF files are portrait and so all the PDF viewers display the scanned documents in portrait.
Regarding the installation of pdftk on Fedora, I found this link. I just stumbled upon this thread and saw that there is no good solution mentioned yet. I found that at least on Debian and Ubuntu pdfjam comes with the following commands:. I think that is the easiest and fastest approach.
These are scripts using the pdfjam command properly. You can use ImageMagick: display or convert - e. Only use this method when the original image is a bitmap e. If the original image is not a bitmap, this method will convert it to one and quality will suffer. In the latter case, please use one of the methods in the other answers.
In Linux Mint From the documentation :. Apply rotation to specified pages. The page-range portion of the option value has the same format as page ranges in Section 3. If the page range is omitted, the rotation is applied to all pages.
The angle portion of the parameter may be either 90,or Otherwise the pages' rotations are set to the exact value. For example, the command qpdf in.
Install and run it. Open the desired pdf file, right click on the page, and rotate each one individually.
It also collate pdfs and some other nice things. This was for a. I found that -density reduced quality somewhat versus -density PDFedit rotates the same image with unchanged quality without noticably changing the file size.
I use this command to automatically rotate pdf files to become upright down if they aren't upright in the first place :.
Subscribe to RSS
Not the solution for this question but i found a way to rotate without installing softwares or using another websites. Ubuntu also comes with Images Viewer that let you viewrotate and print to pdf your image.
Sign up to join this community.Review your favorite Linux distribution. Welcome to LinuxQuestions. You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features.
Registration is quick, simple and absolutely free. Join our community today! Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestions. If you need to reset your password, click here. Having a problem logging in? Please visit this page to clear all LQ-related cookies. Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free. Hello, im using cups filter 'texttops', to generate postscript file, then I;m using ghostscript to create pdf file. The problem is, that file generated from texttops don't contain landscape orientation instructions. How can I force ghostscript to do that. Last edited by kofucii; at AM. Thread Tools. BB code is On. Smilies are On.
All times are GMT The time now is AM. Open Source Consulting Domain Registration. Search Blogs. Mark Forums Read. User Name. Remember Me? Linux - Newbie This Linux forum is for members that are new to Linux. Just starting out and have a question? If it is not in the man pages or the how-to's this is the place! How to create landscape oriented pdf with ghostscript? View Public Profile.I really need to create landscape slides PDFs from landscape printing from a vb.
So I had a look under the bonnet of PDFCreator and realised it is little more than a wrapper around a product called Ghostscript.
Still no luck! This time I had success. The output from my application reliably produces landscape output from a landscape original. For example, if the file quit. Each argument must be valid PostScript, either individual tokens as defined by the token operator, or a string containing valid PostScript. Because Ghostscript must initialize the PostScript environment before executing the commands specified by this option it should be specified after other setup options.
Thanks for sharing, we will look at this to see if we can improve the situation in PDFCreator which is a lot more than just a wrapper around Ghostscript - see the source on GitHub.
It is clear that the driver works by first spooling a postscript file and finally converting this file to a PDF. This conversion to a PDF appears to be powered by Ghostscript. I am not sure in which environment Ghostscript is being called, so am not sure what to escape or how to escape it.
Thanks for indicating where the source code can be found. A look through the code identifies a potential problem. This issue might be the UnescapeString method. I guess this is pdfforge code as I cannot find any documentation. Finally, I have discovered a simple solution to this problem.
It keeps asking "No script file is specified". What should I do? BTW, I'm using a Japanese keyboard. Does that potentially cause any trouble? English Help. Hi, I really need to create landscape slides PDFs from landscape printing from a vb.
So like buses, I now have two different functional solutions. TIFF file rotate automatically. W June 26,am 2. Hi Robin, It is clear that the driver works by first spooling a postscript file and finally converting this file to a PDF. Can you advise further? Many thanks. Hi Robin, Thanks for indicating where the source code can be found. UnescapeString data.