Help:Manual Toolsadvgs: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
(Created page with "Category:Help_Manual Table of Contents <h2>Advanced Ghostscript and GSview Hints</h2> <p>One of the frustrations for users of RPM-based or commercially created...")
 
No edit summary
 
Line 4: Line 4:


<h2>Advanced Ghostscript and GSview Hints</h2> <p>One of the frustrations for users of RPM-based or commercially created distributions, is the lack of availability of the latest versions of Ghostscript(GS). Because of the differences in licensing between the GPL Ghostscript and AFPL Ghostscript, GPL Ghostscript releases usually follow by about a year, the release of the most up to date AFPL GS. Because, there are certain restrictions in AFPL, most Linux distributions ship an older and heavily patched version of GPL Ghostscript.</p> <p>As the current GS 8.x resource configuration (where it looks for fonts and fontmaps) is new, simply dropping in the latest GS tarball and rebuilding the RPM does not quite work. Lord knows I've tried on Red Hat and I consider myself to be pretty well versed in RPM building. If you have ever seen the Red Hat or Suse rpm spec file for GS, you will know what I mean. ;)</p> <p>So, why do I want to go to the trouble of worrying about having the absolute latest version of GS? Not so difficult.</p> <ol> <li>There are real substantial improvements in the ability of GS 8.5+ to handle EPS and PDF files which have the kinds of advanced features Scribus and other DTP applications can create. This can in some cases directly affect the quality of EPS and PS imports into Scribus.</li> <li>You can build it with full on compiler optimization, which speeds up print and separation previews in Scribus. Many distributions only compile it with i386 instructions. This is probably more beneficial to older workstations compared to newer ones. Image processing programs are one area where compiler optimizations do make a difference.</li> <li>Having the latest GS, makes GSview (and Scribus) more capable and more robust at handling both EPS files and a special kind of EPS called DCS 2.0.</li> <li>Both Scribus and GSview have the ability in their preferences settings to use alternative locations for GS and GS libraries.</li> </ol> <p>So, how does one get the latest GS for Scribus and GSview - without breaking your existing distribution printing setup? The secret: a parallel build of GS.</p> <p><strong>Disclaimer:</strong> This works for me. It could wreck your system, catch your hair on fire and other nastiness.</p> <p>First Steps:</p> <ul> <li>Get the latest GS from here: [http://sourceforge.net/project/showfiles.php?group_id=1897&amp;package_id=108733  Ghostscript Downloads]</li> <li>You can manually tweak the make files the old way or</li> <li>Use the new configure script with the following options (and optionally <code>-with-jasper</code> and <code>-with-rinkj</code> with very latest versions):</li> </ul> <blockquote> <table width="100%" border="1" bgcolor="#EEEEEE"> <tr> <td border="0"> <pre> ./configure --enable-compile-inits -with-x </pre></td> </tr> </table> </blockquote> <p>By default, '<code>make install</code>' will install all the files in '<code>/usr/local/bin</code>', '<code>/usr/local/lib</code>' etc. You can specify an installation prefix other than '<code>/usr/local</code>' using '<code>--prefix</code>', for instance '</p> <blockquote> <table width="100%" border="1" bgcolor="#EEEEEE"> <tr> <td border="0"> <pre> --prefix=$HOME </pre></td> </tr> </table> </blockquote> <p>This default usually works fine and keeps the two sets of GS libs separated.</p> <p>Second Steps:</p> <p>There is a second step to compile Ghostscript as a shared library, which GSview needs:</p> <blockquote> <table width="100%" border="1" bgcolor="#EEEEEE"> <tr> <td border="0"> <pre> make so </pre></td> </tr> </table> </blockquote> <p>and as root:</p> <blockquote> <table width="100%" border="1" bgcolor="#EEEEEE"> <tr> <td border="0"> <pre> make soinstall </pre></td> </tr> </table> </blockquote> <p>Now, let's check briefly:</p> <blockquote> <table width="100%" border="1" bgcolor="#EEEEEE"> <tr> <td border="0"> <pre> /usr/local/bin/gs -h </pre></td> </tr> </table> </blockquote> <p>You should have an output something like this:</p> <blockquote> <table width="100%" border="1" bgcolor="#EEEEEE"> <tr> <td border="0"> <pre> AFPL Ghostscript 8.51 (2005-04-18) Copyright (C) 2005 artofcode LLC, Benicia, CA.  All rights reserved. Usage: gs [switches] [file1.ps file2.ps ...] Most frequently used switches: (you can use # in place of =)  -dNOPAUSE          no pause after page  | -q        'quiet', fewer messages  -g&lt;width&gt;x&lt;height&gt;  page size in pixels  | -r&lt;res&gt;  pixels/inch resolution  -sDEVICE=&lt;devname&gt;  select device        | -dBATCH  exit after last file  -sOutputFile=&lt;file&gt; select output file: - for stdout, |command for pipe,                                          embed %d or %ld for page # Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PostScriptLevel3 PDF Default output device: x11 Available devices:    bbox bit bitcmyk bitrgb bj10e bj200 bjc600 bjc800 bmp16 bmp16m bmp256    bmp32b bmpgray bmpmono bmpsep1 bmpsep8 cdeskjet cdj550 cdjcolor cdjmono    cljet5 cljet5c deskjet devicen djet500 epswrite faxg3 faxg32d faxg4 ijs    jpeg jpeggray laserjet lj5gray lj5mono ljet2p ljet3 ljet3d ljet4 ljet4d    ljetplus nullpage pbm pbmraw pcx16 pcx24b pcx256 pcxcmyk pcxgray pcxmono    pdfwrite pgm pgmraw pgnm pgnmraw pj pjxl pjxl300 pkm pkmraw pksm pksmraw    png16 png16m png256 pngalpha pnggray pngmono pnm pnmraw ppm ppmraw    psdcmyk psdrgb psgray psmono psrgb pswrite pxlcolor pxlmono spotcmyk    tiff12nc tiff24nc tiffcrle tiffg3 tiffg32d tiffg4 tifflzw tiffpack    uniprint x11 x11alpha x11cmyk x11gray2 x11gray4 x11mono xcf Search path:    . : /home/peter/.fonts : /usr/local/share/ghostscript/8.51/lib :    /usr/local/share/ghostscript/8.51/Resource :    /usr/share/ghostscript/fonts </pre></td> </tr> </table> </blockquote> <p>The key thing here is:</p> <ol> <li>You see the correct version of GS. Otherwise, you might need to adjust your <code>$PATH</code> settings</li> <li>You have <code>pngalpha</code> and the <code>x11</code> devices listed, along with <code>bitcmyk</code> for cmyk preview, and <code>png16m</code>.</li> <li>There is a reasonable search path for fonts, so GS can find your fonts. You will get errors in Scribus, when attempting to import EPS files or using the print preview, if this path is not set correctly and GS cannot find fonts. GS determines where to find fonts in a file called Fontmap. Setting this option is explained in the GS documentation.</li> </ol> <p>If you are concerned about messing about with your existing packaging setup, you could use: <code>checkinstall</code> or <code>Xstow</code>. These programs will keep track of applications which are outside of your normal packaging system. I have used checkinstall with good luck in these kinds of situations on Red Hat systems.</p> <p>Next,if installed, open up GSview and go to <strong>Options.. &gt; Advanced Configure</strong>. Then, make sure the "Ghostscript Shared Object" is pointing at the correct libgs.so. Below is how I have setup GSview on my system.:</p> <table width="100%"> <tr> <td align="center">[[File:Help_gsadv1.png|alt= "GSview - Advanced Options Panel"]]</td> </tr> </table> <p>Next, we need to tell Scribus where to find the newer GS. Go <strong>Edit..&gt; Preferences.. &gt;General</strong>. Then in External Tools, add the path for the new Ghostscript under PostScript Interpreter.</p> <table width="100%"> <tr> <td align="center">[[File:Help_gsadv2.png|alt= "Scribus External Tools Preferences"]]</td> </tr> </table> <p>Another tool which is available with GSview is <code>epstool</code>. An older version is shipped with the current GSview 4.6, but a newer one is available on the GSview home page. This is a great command line tool, which can perform advanced EPS/DCS 2.0 conversion. This is very useful when someone sends you an EPS file from other DTP applications - even those created on Macs. Upgrading this to work with GSview gives you excellent support on Linux to handle EPS files from all platforms. Recommended.</p> <p>Lastly, one other tool which works as a plug-in with GSview is <code>pstoedit</code> This is a command line tool for converting bitmap images into vectors and PostScript, which then, depending on the nature of the image, can be edited in a vector drawing tool like Inkscape or Skencil. See the section Import Hints for hints on how I used this to convert the Scribus logo into SVG and then a native Scribus file. GSview uses this as a plug-in to convert files into vector format.</p> <p>GSview has been, in my experience, the most reliable and versatile EPS/PS viewer on Linux. How good is it ? Well, the best example is letting you know this usually installed on every Windows DTP workstation I support for clients. For DTP with Scribus, I consider it essential.</p>
<h2>Advanced Ghostscript and GSview Hints</h2> <p>One of the frustrations for users of RPM-based or commercially created distributions, is the lack of availability of the latest versions of Ghostscript(GS). Because of the differences in licensing between the GPL Ghostscript and AFPL Ghostscript, GPL Ghostscript releases usually follow by about a year, the release of the most up to date AFPL GS. Because, there are certain restrictions in AFPL, most Linux distributions ship an older and heavily patched version of GPL Ghostscript.</p> <p>As the current GS 8.x resource configuration (where it looks for fonts and fontmaps) is new, simply dropping in the latest GS tarball and rebuilding the RPM does not quite work. Lord knows I've tried on Red Hat and I consider myself to be pretty well versed in RPM building. If you have ever seen the Red Hat or Suse rpm spec file for GS, you will know what I mean. ;)</p> <p>So, why do I want to go to the trouble of worrying about having the absolute latest version of GS? Not so difficult.</p> <ol> <li>There are real substantial improvements in the ability of GS 8.5+ to handle EPS and PDF files which have the kinds of advanced features Scribus and other DTP applications can create. This can in some cases directly affect the quality of EPS and PS imports into Scribus.</li> <li>You can build it with full on compiler optimization, which speeds up print and separation previews in Scribus. Many distributions only compile it with i386 instructions. This is probably more beneficial to older workstations compared to newer ones. Image processing programs are one area where compiler optimizations do make a difference.</li> <li>Having the latest GS, makes GSview (and Scribus) more capable and more robust at handling both EPS files and a special kind of EPS called DCS 2.0.</li> <li>Both Scribus and GSview have the ability in their preferences settings to use alternative locations for GS and GS libraries.</li> </ol> <p>So, how does one get the latest GS for Scribus and GSview - without breaking your existing distribution printing setup? The secret: a parallel build of GS.</p> <p><strong>Disclaimer:</strong> This works for me. It could wreck your system, catch your hair on fire and other nastiness.</p> <p>First Steps:</p> <ul> <li>Get the latest GS from here: [http://sourceforge.net/project/showfiles.php?group_id=1897&amp;package_id=108733  Ghostscript Downloads]</li> <li>You can manually tweak the make files the old way or</li> <li>Use the new configure script with the following options (and optionally <code>-with-jasper</code> and <code>-with-rinkj</code> with very latest versions):</li> </ul> <blockquote> <table width="100%" border="1" bgcolor="#EEEEEE"> <tr> <td border="0"> <pre> ./configure --enable-compile-inits -with-x </pre></td> </tr> </table> </blockquote> <p>By default, '<code>make install</code>' will install all the files in '<code>/usr/local/bin</code>', '<code>/usr/local/lib</code>' etc. You can specify an installation prefix other than '<code>/usr/local</code>' using '<code>--prefix</code>', for instance '</p> <blockquote> <table width="100%" border="1" bgcolor="#EEEEEE"> <tr> <td border="0"> <pre> --prefix=$HOME </pre></td> </tr> </table> </blockquote> <p>This default usually works fine and keeps the two sets of GS libs separated.</p> <p>Second Steps:</p> <p>There is a second step to compile Ghostscript as a shared library, which GSview needs:</p> <blockquote> <table width="100%" border="1" bgcolor="#EEEEEE"> <tr> <td border="0"> <pre> make so </pre></td> </tr> </table> </blockquote> <p>and as root:</p> <blockquote> <table width="100%" border="1" bgcolor="#EEEEEE"> <tr> <td border="0"> <pre> make soinstall </pre></td> </tr> </table> </blockquote> <p>Now, let's check briefly:</p> <blockquote> <table width="100%" border="1" bgcolor="#EEEEEE"> <tr> <td border="0"> <pre> /usr/local/bin/gs -h </pre></td> </tr> </table> </blockquote> <p>You should have an output something like this:</p> <blockquote> <table width="100%" border="1" bgcolor="#EEEEEE"> <tr> <td border="0"> <pre> AFPL Ghostscript 8.51 (2005-04-18) Copyright (C) 2005 artofcode LLC, Benicia, CA.  All rights reserved. Usage: gs [switches] [file1.ps file2.ps ...] Most frequently used switches: (you can use # in place of =)  -dNOPAUSE          no pause after page  | -q        'quiet', fewer messages  -g&lt;width&gt;x&lt;height&gt;  page size in pixels  | -r&lt;res&gt;  pixels/inch resolution  -sDEVICE=&lt;devname&gt;  select device        | -dBATCH  exit after last file  -sOutputFile=&lt;file&gt; select output file: - for stdout, |command for pipe,                                          embed %d or %ld for page # Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PostScriptLevel3 PDF Default output device: x11 Available devices:    bbox bit bitcmyk bitrgb bj10e bj200 bjc600 bjc800 bmp16 bmp16m bmp256    bmp32b bmpgray bmpmono bmpsep1 bmpsep8 cdeskjet cdj550 cdjcolor cdjmono    cljet5 cljet5c deskjet devicen djet500 epswrite faxg3 faxg32d faxg4 ijs    jpeg jpeggray laserjet lj5gray lj5mono ljet2p ljet3 ljet3d ljet4 ljet4d    ljetplus nullpage pbm pbmraw pcx16 pcx24b pcx256 pcxcmyk pcxgray pcxmono    pdfwrite pgm pgmraw pgnm pgnmraw pj pjxl pjxl300 pkm pkmraw pksm pksmraw    png16 png16m png256 pngalpha pnggray pngmono pnm pnmraw ppm ppmraw    psdcmyk psdrgb psgray psmono psrgb pswrite pxlcolor pxlmono spotcmyk    tiff12nc tiff24nc tiffcrle tiffg3 tiffg32d tiffg4 tifflzw tiffpack    uniprint x11 x11alpha x11cmyk x11gray2 x11gray4 x11mono xcf Search path:    . : /home/peter/.fonts : /usr/local/share/ghostscript/8.51/lib :    /usr/local/share/ghostscript/8.51/Resource :    /usr/share/ghostscript/fonts </pre></td> </tr> </table> </blockquote> <p>The key thing here is:</p> <ol> <li>You see the correct version of GS. Otherwise, you might need to adjust your <code>$PATH</code> settings</li> <li>You have <code>pngalpha</code> and the <code>x11</code> devices listed, along with <code>bitcmyk</code> for cmyk preview, and <code>png16m</code>.</li> <li>There is a reasonable search path for fonts, so GS can find your fonts. You will get errors in Scribus, when attempting to import EPS files or using the print preview, if this path is not set correctly and GS cannot find fonts. GS determines where to find fonts in a file called Fontmap. Setting this option is explained in the GS documentation.</li> </ol> <p>If you are concerned about messing about with your existing packaging setup, you could use: <code>checkinstall</code> or <code>Xstow</code>. These programs will keep track of applications which are outside of your normal packaging system. I have used checkinstall with good luck in these kinds of situations on Red Hat systems.</p> <p>Next,if installed, open up GSview and go to <strong>Options.. &gt; Advanced Configure</strong>. Then, make sure the "Ghostscript Shared Object" is pointing at the correct libgs.so. Below is how I have setup GSview on my system.:</p> <table width="100%"> <tr> <td align="center">[[File:Help_gsadv1.png|alt= "GSview - Advanced Options Panel"]]</td> </tr> </table> <p>Next, we need to tell Scribus where to find the newer GS. Go <strong>Edit..&gt; Preferences.. &gt;General</strong>. Then in External Tools, add the path for the new Ghostscript under PostScript Interpreter.</p> <table width="100%"> <tr> <td align="center">[[File:Help_gsadv2.png|alt= "Scribus External Tools Preferences"]]</td> </tr> </table> <p>Another tool which is available with GSview is <code>epstool</code>. An older version is shipped with the current GSview 4.6, but a newer one is available on the GSview home page. This is a great command line tool, which can perform advanced EPS/DCS 2.0 conversion. This is very useful when someone sends you an EPS file from other DTP applications - even those created on Macs. Upgrading this to work with GSview gives you excellent support on Linux to handle EPS files from all platforms. Recommended.</p> <p>Lastly, one other tool which works as a plug-in with GSview is <code>pstoedit</code> This is a command line tool for converting bitmap images into vectors and PostScript, which then, depending on the nature of the image, can be edited in a vector drawing tool like Inkscape or Skencil. See the section Import Hints for hints on how I used this to convert the Scribus logo into SVG and then a native Scribus file. GSview uses this as a plug-in to convert files into vector format.</p> <p>GSview has been, in my experience, the most reliable and versatile EPS/PS viewer on Linux. How good is it ? Well, the best example is letting you know this usually installed on every Windows DTP workstation I support for clients. For DTP with Scribus, I consider it essential.</p>
{{OPL}}

Latest revision as of 18:38, 29 March 2012


Table of Contents

Advanced Ghostscript and GSview Hints

One of the frustrations for users of RPM-based or commercially created distributions, is the lack of availability of the latest versions of Ghostscript(GS). Because of the differences in licensing between the GPL Ghostscript and AFPL Ghostscript, GPL Ghostscript releases usually follow by about a year, the release of the most up to date AFPL GS. Because, there are certain restrictions in AFPL, most Linux distributions ship an older and heavily patched version of GPL Ghostscript.

As the current GS 8.x resource configuration (where it looks for fonts and fontmaps) is new, simply dropping in the latest GS tarball and rebuilding the RPM does not quite work. Lord knows I've tried on Red Hat and I consider myself to be pretty well versed in RPM building. If you have ever seen the Red Hat or Suse rpm spec file for GS, you will know what I mean. ;)

So, why do I want to go to the trouble of worrying about having the absolute latest version of GS? Not so difficult.

  1. There are real substantial improvements in the ability of GS 8.5+ to handle EPS and PDF files which have the kinds of advanced features Scribus and other DTP applications can create. This can in some cases directly affect the quality of EPS and PS imports into Scribus.
  2. You can build it with full on compiler optimization, which speeds up print and separation previews in Scribus. Many distributions only compile it with i386 instructions. This is probably more beneficial to older workstations compared to newer ones. Image processing programs are one area where compiler optimizations do make a difference.
  3. Having the latest GS, makes GSview (and Scribus) more capable and more robust at handling both EPS files and a special kind of EPS called DCS 2.0.
  4. Both Scribus and GSview have the ability in their preferences settings to use alternative locations for GS and GS libraries.

So, how does one get the latest GS for Scribus and GSview - without breaking your existing distribution printing setup? The secret: a parallel build of GS.

Disclaimer: This works for me. It could wreck your system, catch your hair on fire and other nastiness.

First Steps:

  • Get the latest GS from here: Ghostscript Downloads
  • You can manually tweak the make files the old way or
  • Use the new configure script with the following options (and optionally -with-jasper and -with-rinkj with very latest versions):
 ./configure --enable-compile-inits -with-x 

By default, 'make install' will install all the files in '/usr/local/bin', '/usr/local/lib' etc. You can specify an installation prefix other than '/usr/local' using '--prefix', for instance '

 --prefix=$HOME 

This default usually works fine and keeps the two sets of GS libs separated.

Second Steps:

There is a second step to compile Ghostscript as a shared library, which GSview needs:

 make so 

and as root:

 make soinstall 

Now, let's check briefly:

 /usr/local/bin/gs -h 

You should have an output something like this:

 AFPL Ghostscript 8.51 (2005-04-18) Copyright (C) 2005 artofcode LLC, Benicia, CA.  All rights reserved. Usage: gs [switches] [file1.ps file2.ps ...] Most frequently used switches: (you can use # in place of =)  -dNOPAUSE           no pause after page   | -q        'quiet', fewer messages  -g<width>x<height>  page size in pixels   | -r<res>  pixels/inch resolution  -sDEVICE=<devname>  select device         | -dBATCH  exit after last file  -sOutputFile=<file> select output file: - for stdout, |command for pipe,                                          embed %d or %ld for page # Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PostScriptLevel3 PDF Default output device: x11 Available devices:    bbox bit bitcmyk bitrgb bj10e bj200 bjc600 bjc800 bmp16 bmp16m bmp256    bmp32b bmpgray bmpmono bmpsep1 bmpsep8 cdeskjet cdj550 cdjcolor cdjmono    cljet5 cljet5c deskjet devicen djet500 epswrite faxg3 faxg32d faxg4 ijs    jpeg jpeggray laserjet lj5gray lj5mono ljet2p ljet3 ljet3d ljet4 ljet4d    ljetplus nullpage pbm pbmraw pcx16 pcx24b pcx256 pcxcmyk pcxgray pcxmono    pdfwrite pgm pgmraw pgnm pgnmraw pj pjxl pjxl300 pkm pkmraw pksm pksmraw    png16 png16m png256 pngalpha pnggray pngmono pnm pnmraw ppm ppmraw    psdcmyk psdrgb psgray psmono psrgb pswrite pxlcolor pxlmono spotcmyk    tiff12nc tiff24nc tiffcrle tiffg3 tiffg32d tiffg4 tifflzw tiffpack    uniprint x11 x11alpha x11cmyk x11gray2 x11gray4 x11mono xcf Search path:    . : /home/peter/.fonts : /usr/local/share/ghostscript/8.51/lib :    /usr/local/share/ghostscript/8.51/Resource :    /usr/share/ghostscript/fonts 

The key thing here is:

  1. You see the correct version of GS. Otherwise, you might need to adjust your $PATH settings
  2. You have pngalpha and the x11 devices listed, along with bitcmyk for cmyk preview, and png16m.
  3. There is a reasonable search path for fonts, so GS can find your fonts. You will get errors in Scribus, when attempting to import EPS files or using the print preview, if this path is not set correctly and GS cannot find fonts. GS determines where to find fonts in a file called Fontmap. Setting this option is explained in the GS documentation.

If you are concerned about messing about with your existing packaging setup, you could use: checkinstall or Xstow. These programs will keep track of applications which are outside of your normal packaging system. I have used checkinstall with good luck in these kinds of situations on Red Hat systems.

Next,if installed, open up GSview and go to Options.. > Advanced Configure. Then, make sure the "Ghostscript Shared Object" is pointing at the correct libgs.so. Below is how I have setup GSview on my system.:

"GSview - Advanced Options Panel"

Next, we need to tell Scribus where to find the newer GS. Go Edit..> Preferences.. >General. Then in External Tools, add the path for the new Ghostscript under PostScript Interpreter.

"Scribus External Tools Preferences"

Another tool which is available with GSview is epstool. An older version is shipped with the current GSview 4.6, but a newer one is available on the GSview home page. This is a great command line tool, which can perform advanced EPS/DCS 2.0 conversion. This is very useful when someone sends you an EPS file from other DTP applications - even those created on Macs. Upgrading this to work with GSview gives you excellent support on Linux to handle EPS files from all platforms. Recommended.

Lastly, one other tool which works as a plug-in with GSview is pstoedit This is a command line tool for converting bitmap images into vectors and PostScript, which then, depending on the nature of the image, can be edited in a vector drawing tool like Inkscape or Skencil. See the section Import Hints for hints on how I used this to convert the Scribus logo into SVG and then a native Scribus file. GSview uses this as a plug-in to convert files into vector format.

GSview has been, in my experience, the most reliable and versatile EPS/PS viewer on Linux. How good is it ? Well, the best example is letting you know this usually installed on every Windows DTP workstation I support for clients. For DTP with Scribus, I consider it essential.

This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder. A copy of the license is included in the section entitled "Text of the Open Publication License."