Use ghostscript software
Some files have a TrimBox that is smaller than the MediaBox and may include white space, registration or cutting marks outside the CropBox. Using this option simulates appearance of the finished printed page. The art box defines the extent of the page's meaningful content including potential white space as intended by the page's creator. The art box is likely to be the smallest box.
It can be useful when one wants to crop the page as much as possible without losing the content. Unlike the other "page boundary" boxes, CropBox does not have a defined meaning, it simply provides a rectangle to which the page contents will be clipped cropped. By convention, it is often, but not exclusively, used to aid the positioning of content on the usually larger, in these cases media.
For files created with encryption method 4 or earlier, the password is an arbitrary string of bytes; with encryption method 5 or later, it should be text in either UTF-8 or your locale's character set Ghostscript tries both.
Annotations are shown by default. By default, AcroForm processing is now enabled because Adobe Acrobat does this. This option is provided to restore the previous behavior which corresponded to older Acrobat. This may be useful for backward compatibility with old versions of Ghostscript and Adobe Acrobat, or for processing files with large values of UserUnit that otherwise exceed implementation limits.
On TrueType fonts, this is often a hollow sqaure. Ghostscript now attempts to mimic this undocumented feature using a user parameter RenderTTNotdef. Pages of all documents in PDF collections are numbered sequentionally. A list can include single pages or ranges of pages. Ranges of pages use the minus sign '-', individual pages and ranges of pages are separated by commas ','. A trailing minus '-' means process all remaining pages.
Note: The differences in appearance of files with overprinting and spot colors caused by the differences in the color model of the output device are part of the PostScript and PDF specifications. They are not due to a limitation in the implementation of Ghostscript or its output devices.
In Adobe Acrobat, viewing of the effects of overprinting is enabled by the 'Overprint Preview' item in the 'Advanced' menu. This feature is not available in the free Acrobat Reader. The free Acrobat Reader also uses the tint transform functions to convert spot colors to the appropriate alternate color space.
Testing a file name for an absolute path System Does the name VMS Contain a node, device, or root specification?
Finding PostScript Level 2 resources Adobe specifies that resources are installed in a single directory. It concatenates : The value of the system parameter GenericResourceDir ; The name of the resource category for instance, CMap ; The name of the resource instance for instance, Identity-H.
In this case it concatenates : A directory listed in the section How Ghostscript finds files , except the current directory; The value of the system parameter GenericResourceDir ; The name of the resource category for instance, CMap ; The name of the resource instance for instance, Identity-H Due to possible variety of the part 1, the first successful combination is used.
Font lookup Ghostscript has a slightly different way to find the file containing a font with a given name. First, it looks up the font name in the combined Fontmaps. If this process fails at any step, Ghostscript looks for a file whose name is the concatenation of the value of the FontResourceDir system parameter and the font name, with no extension.
If such a file exists, can be loaded, and defines a font of the desired name, that again is the end. If that fails, Ghostscript then looks for a file on the general search path whose name is the desired font name, with no extension.
It goes to the first directory on the list, and it's descendants, looking for all files that appear to contain PostScript fonts also Truetype fonts ; it then adds all those files and fonts to the combined Fontmaps, and starts over.
Finally, if all else fails, it will try to find a substitute for the font from among the standard 35 fonts. Font-name-to-file-name mapping given in Fontmap files; aliases are possible, and there need not be any relation between the font name in the Fontmap and the FontName in the file.
Font-name-to-file-name mapping is implicit — the FontName in the file is used. Aliases are not possible. Only fonts and files named in Fontmap are used. Every Type 1 font file in each directory is available; if TrueType fonts are supported the ttfont. This must be an absolute path. This is ignored if Path doesn't specify a collection. The first font in a collection is 0.
Default value is 0. Notes on specific platforms Word size 32 or 64 bits The original PostScript language specification, while not stating a specific word sise, defines 'typical' limits which make it clear that it was intended to run as a bit environment. However this is, obviously, dependent on the operating system and compiler support available. Not all builds of Ghostscript will support bit integers, though some bit builds eg Windows will.
Unix The Ghostscript distribution includes some Unix shell scripts to use with Ghostscript in different environments. Although VMS DCL itself converts unquoted parameters to upper case, C programs such as Ghostscript receive their parameters through the C runtime library, which forces all unquoted command-line parameters to lower case.
Note: This definitely matters if Ghostscript was compiled with DEC C; we are not sure of the situation if you use gcc. Xdefaults Ghostscript doesn't look at the default system background and foreground colors; if you want to change the background or foreground color, you must set them explicitly for Ghostscript.
This is a deliberate choice, so that PostScript documents will display correctly by default -- with white as white and black as black -- even if text windows use other colors. The geometry resource affects only window placement. The font tolerance gives the largest acceptable difference in height of the screen font, expressed as a percentage of the height of the desired font.
The palette resource can be used to restrict Ghostscript to using a grayscale or monochrome palette. Ghostscript never preallocates more than half the cells in a colormap. Working around bugs in X servers The " use Some servers do not implement backing pixmaps properly, or do not have enough memory for them. If you get strange behavior or "out of memory" messages, try setting useBackingPixmap to false. Some servers do not implement tiling properly. This appears as broad bands of color where dither patterns should appear.
If this happens, try setting useXSetTile to false. Some servers do not implement bitmap or pixmap displaying properly. This may appear as white or black rectangles where characters should appear; or characters may appear in "inverse video" for instance, white on a black rectangle rather than black on white.
If this happens, try setting useXPutImage to false. X device parameters In addition to the device parameters recognized by all devices , Ghostscript's X driver provides parameters to adjust its performance.
Using a client-side pixmap usually provides better performance -- for bitmap images, possibly much better performance -- but since it may require quite a lot of RAM e. For details, please consult the source file gdevx. Command line options Unless otherwise noted, these switches can be used on all platforms.
General switches Input control filename Causes Ghostscript to read filename and treat its contents the same as the command line.
This was intended primarily for getting around DOS's character limit on the length of a command line. Switches or file names in the file may be separated by any amount of white space space, tab, line break ; there is no limit on the size of the file.
Takes the next argument as a file name as usual, but takes all remaining arguments even if they have the syntactic form of switches and defines the name ARGUMENTS in userdict not systemdict as an array of those strings, before running the file.
When Ghostscript finishes executing the file, it exits back to the shell. On some systems, Ghostscript may read the input one character at a time, which is useful for programs such as ghostview that generate input for Ghostscript dynamically and watch for some response, but can slow processing.
However, ' - ' is equivalent on most systems. Interprets arguments as PostScript code up to the next argument that begins with " - " followed by a non-digit, or with " ". 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. Since this is the default behavior, -f is useful only for terminating the list of tokens for the -c switch.
File searching Note that by "library files" here we mean all the files identified using the search rule under " How Ghostscript finds files " above: Ghostscript's own initialization files, fonts, and files named on the command line. This is now the default. The value must be a valid PostScript token as defined by the token operator. If the token is a non-literal name, it must be true, false, or null.
It is recommeded that this is used only for simple values -- use -c above for complex values such as procedures, arrays or dictionaries. Note that these values are defined before other names in systemdict, so any name that that conflicts with one usually in systemdict will be replaced by the normal definition during the interpreter initialization. This is different from -d. The string takes a parameter definition in something very close to postscript format.
This allows more complex structures to be passed in than is possible with -d or -s. Parameter switches -d and -s As noted above, -d and -s define initial values for PostScript names. Their use is highly recommended for producing high quality rasterizations. The subsampling box size 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.
Allowed values are 1, 2 or 4. Subpixels are a smaller raster grid which is used internally for text antialiasing. It controls grid fitting of True Type fonts Sometimes referred to as "hinting", but strictly speaking the latter is a feature of Type 1 fonts. Setting this to 2 enables automatic grid fitting for True Type glyphs.
The value 0 disables grid fitting. The default value is 2. For more information see the description of the user parameter GridFitTT. If accurate colors are desired, it is recommended that an ICC workflow be used. Useful only on very slow systems where color accuracy is less important.
This switch is primarily useful for PDF creation using the pdfwrite device when retaining the color spaces from the original document is important. ICC profiles are sometimes embedded by applications to convey the exact input color space allowing better color fidelity. Normally, these operators are not accessible from Postscript jobs, being primarily intended to be called by the PDF interpreter. It is important that these operators are used correctly, especially the order in which they are called, otherwise unintended, even undefined behavior may result.
These psuedo operators are not a part of the official Postscript specification. These psuedo operators are required for some files from QuarkXPress. However some files from Corel 9 and Illustrator 88 do not operate properly if these operators are present.
DoPS has in fact been deprecated for some time. Also the "PS" operator that was removed from the 1. Use of this option is NOT recommended in security-conscious applications, as it increases the scope for malicious code. Note: in releases 7. This occurs for text fill and text stroke operations. PDF output created with this setting will be updated to be drawn with gray values of 0.
Type 3 fonts, which are sometimes used for graphics, are not affected by this parameter. This may be useful when printing documents on a printer that can handle their requested paper size but whose default is some other size. The pages are scaled and arranged on the current PageSize "master" page according the the option.
Default value is. It's meaning is similar to GenericResourceDir. Interaction-related parameters -dBATCH Causes Ghostscript to exit after processing all files named on the command line, rather than going into an interactive loop reading PostScript commands.
Equivalent to putting -c quit at the end of the command line. This may be useful on PC displays that get confused if a program attempts to write text to the console while the display is in a graphics mode. Normally one should use this along with -dBATCH when producing output on a printer or to a file; it also may be desirable for applications where another program is "driving" Ghostscript.
This allows piping input directly into Ghostscript, as long as the data doesn't refer to currentfile. This is currently necessary when redirecting device output to standard output. This may be useful if input is coming from a pipe. This is usually useful only when running PostScript code whose purpose is to compute something rather than to produce an output image. This switch instructs all devices to ignore a request to print multiple copies, giving more consistent behaviour.
Refer to the SavedPages document for details. This is useful when converting an EPS file to a bitmap. This is useful for shrinking or enlarging an EPS file to fit the paper size when printing. With this interface it is possible to provide this definition.
The colorants tag order in the ICC profile defines the lay-down order of the inks associated with the profile. A windows-based tool for creating these source profiles is contained in. Care should be taken to ensure that the number of colorants associated with the device is the same as the profile. If this is not set, an appropriate profile i. In this case, spot colors will pass through unprocessed assuming the device supports those colorants.
In this case, the list of the color names in the order that they exist in the profile must be provided with this command line option. Note that if a color name that is specified for the profile occurs also within the document e. Additional names beyond those of the ICC profile component count can be included. In this case, those components will be installed into the tiffsep or psdcmyk device list of colors, following the ICC profile colors.
In addition, we desire to allow one more spot color of the document to come through to our device. Note that it is up to the device or through the use of -sNamedProfile see below to involve the setting of any values in the Varnish channel. However, if an All color value is encountered in the document, the Varnish component will have its value set as will the Orange and Violet values Likewise if a spot color named Varnish is encountered in the document the Varnish component will be used for the values.
The All value is typically used for placing registration targets on separations. See the document GS9 Color Management for details about this option. This profile is used following the output device profile. Care should be taken to ensure that the output device process color model is the same as the output color space for the device link profile.
In addition, the color space of the OutputICCProfile should match the input color space of the device link profile. While the ICC does define a named color format, this structure can in practice be much more general. Many developers wish to use their own proprietary-based format for spot color management. An example implementation is currently contained in the code for the handling of both Separation and DeviceN colors. For the general user this command option should really not be used.
Some files lack this specification, in which case the blending occurs in the output device's native color space. This dependency of blending color space on the device color model can be avoided by using the above command to force a specific color space in which to perform the blending. A setting of 0 will result in less accurate color rendering compared to a setting of 2. However, the creation of a transformation will be faster at a setting of 0 compared to a setting of 2.
Default setting is 2. This is only valid when using littleCMS for color management. Fill, Stroke operations. This can be used to obtain more saturated colors for graphics. The options are the same as specified for -dRenderIntent. The options are the same as specified for -dKPreserve. This can be used to obtain perceptually pleasing images.
This can be used ensure K only text. Note that if no profiles are specified for the default Device color spaces, then the system default profiles will be used.
The specification is made through a file that contains on a line a key name to specify the object type e. It is also possible to turn off color management for certain object types, use device link profiles for object types and do custom color replacements.
An example file is given in. Profiles to demonstrate this method of specification are also included in this folder. Note that if objects are colorimetrically specified through this mechanism other operations like -dImageIntent, -dOverrideICC, have no affect.
See further details in the document GS9 Color Management. This may not always be desired. In particular, it may be desired to map from the gray ICC profile specified by -sDefaultGrayProfile to the output device profile.
The directory path must end with a file system delimiter. Useful only for certain specialized packages like pstotext that redefine operators. See the documentation for. Normally, pdfmark is only called for these types for PostScript files or when the output device requests it e.
Useful only for debugging. The vmreclaim operator is not disabled. The decision to halftone depends upon the output and source resolution as well as the output and source color space. This is necessary when running special utility programs such as font2c and pcharstr , which must bypass normal PostScript access protection.
Improving performance Ghostscript attempts to find an optimum balance between speed and memory consumption, but there are some cases in which you may get a very large speedup by telling Ghostscript to use more memory. With some PDF files, or if you are using Chinese, Japanese, or other fonts with very large character sets, adding the following sequence of switches before the first file name may dramatically improve performance at the cost of an additional memory.
For example, to allow use of 30Mb of extra RAM use: -c setvmthreshold -f. This overrides the compiled-in default, but is overridden by any commandline setting. Debugging The information here describing is probably interesting only to developers. Debug switches There are several debugging switches that are detected by the interpreter. Each of the xxx characters selects an option.
Case is significant: "a" and "A" have different meanings. Case is significant: "f" and "F" have different meanings.
Visual Trace Visual Trace allows to view internal Ghostscript data in a graphical form while execution of C code. There are two important incompletenesses of the implementation : 1.
In this environment, the relevant section of the resource file should look like this: Ghostscript. FontType integer PostScript type for this font. Only 1 and 42 are currently allowed. Note that this is unrelated to the real type of the font file - the bridge will perform a format conversion.
FAPI name Name of the renderer to be used with the font. It is being ignored if Path doesn't specify a collection. Decoding name optional The name of a Decoding resource to be used with the font. Only 0, 1 and 2 are currently allowed. Note that this is unrelated to the real type of the font file - the bridge will perform format conversion. The first element is a string, which specifies Ordering.
The second element is a number, which specifies Supplement. Used to resolve relative paths in FAPIfontmap. Used to resolve relative paths in FAPIcidfmap. It may be same or different than FontPath. Some even allow you to generate images from PDF pages, but as mentioned earlier, it can be a very time consuming task, especially if you need to convert hundreds of PDF pages. The most recent release of Ghostscript can be downloaded directly from the Ghostscript website. To build and install Ghostscript from its source, download the cross-platform source archive.
What you can expect to see while Ghostscript builds and installs. All I see is blonde… brunette… red-head…. Once it completes, you can see if it installed correctly by checking the currently installed version by entering the following command:. Following are some basic examples of how to use Ghostscript for various tasks. For a detailed guide on how to use Ghostscript, you can view the official documentation online.
These examples assume that you built Ghostscript from the source and are running Apple Mac OS, but you should be able to easily use the standalone builds as well. You will just need to move the standalone builds into your working folder.
To reduce the filesize of the generated images, consider using JPEG as the output format. You can then specify the output quality of the image to reduce its filesize:. The filesize will be significantly less, but the quality will take a hit.
If you only want to convert certain pages, you can specify the start and end page numbers. To improve quality without really affecting filesize, you can set how many bits should be used for rendering text and images. This may include source code for your application. The Corresponding Source includes "all the source code needed to generate, install and for an executable work run the object code and to modify the work, including scripts to control those activities.
If you meet certain criteria, then we will not consider your distribution of your application in an executable form to be in violation of AGPL, even though you ship an executable product that includes your application and Ghostscript. Here are the criteria:. Any other redistribution is not licensed under AGPL. If you cannot meet the requirements of AGPL, please fill out the form below to inquire about a commercial license.
More information on the various licensing options available for our three products follows below. Artifex is the exclusive commercial licensing agent for Ghostscript.
There is no "public domain" version of Ghostscript. The kind of distribution or use you plan to make of Ghostscript will determine whether you need a commercial license from Artifex. If you plan to distribute Ghostscript in one of your products or make them available to your SaaS or ASP customers, you should understand the differences between these licenses.
Please note that the conditions apply even if you ship or make available a free demonstration version of your own product or application. An "application" can be any type of software product or application, tool, system or utility.
0コメント