Difference between revisions of "Using GhostScript for Microsoft Windows"

From Free Knowledge Base- The DUCK Project: information for everyone
Jump to: navigation, search
Line 40: Line 40:
 
* 1 space as delimiter between the generation number and the in-use/free flag
 
* 1 space as delimiter between the generation number and the in-use/free flag
 
* 1 byte for the in-use/free flag
 
* 1 byte for the in-use/free flag
 +
 +
pdf won't convert using ghostscript unless i've saved it in acrobat using 'Optimized PDF'
 +
 +
some times ghostscript fails in opening files due to XREF table corruption
 +
 +
try to repair problematic pdf with
 +
 +
pdftk
 +
 +
    http://www.pdflabs.com/docs/install-pdftk/
 +
 +
pdftk file.pdf output fixed.pdf

Revision as of 23:35, 30 December 2014

gswin32c.exe error occured while reading xref table

Ghostscript PDF to PNG/TIF

gswin32c.exe -dNOPAUSE -dBATCH -r300 -sDEVICE=pnggray -sOutputFile="test.png" "TestFile.PDF"
gswin32c.exe -dNOPAUSE -dBATCH -r300 -sDEVICE=pnggray -sOutputFile="c:\test.png" "c:\internet\Eudora\attach\12-30-2014 6-57 PM.pdf"
copy "c:\internet\Eudora\attach\12-30-2014 6-57 PM.pdf" .\
gswin32c.exe -dNOPAUSE -dBATCH -r300 -sDEVICE=pnggray -sOutputFile="test.png" "test.pdf"


the map file cidfmap was not found

gswin32c.exe -s OutputFile="test.png" "test.pdf"
gswin32c.exe -q -dNOPAUSE -sDEVICE=pngalpha -r300 -dEPSCrop -sOutputFile=test2.png test.pdf
gswin32c.exe -q -sOutputFile="test3.png" "test3.pdf"
gswin32c.exe -dNOPAUSE -dBATCH -r300 -sDEVICE=pnggray -sOutputFile="test.png" "TestFile.PDF"
gswin32c.exe -dNOPAUSE -dBATCH -sDEVICE=pnggray -sOutputFile="test.png" "test3.pdf"
gs -dSAFER -dBATCH document.pdf
gswin32c.exe -dSAFER -dBATCH "C:\Program Files\GPLGS\test3.pdf"

gswin32c.exe error occured while reading xref table

gs test.pdf
GPL Ghostscript 9.06 (2012-08-08)
Copyright (C) 2012 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
**** Error reading a content stream. The page may be incomplete.
**** Warning: An error occurred while reading an XREF table.
**** The file has been damaged. This may have been caused
**** by a problem while converting or transfering the file.
**** Ghostscript will attempt to recover the data.

A valid XREF table should be exactly 20 bytes long.

  • 10 digits for the byte offset
  • 1 space between the byte offset and the generation number
  • 5 digits for the generation number
  • 1 space as delimiter between the generation number and the in-use/free flag
  • 1 byte for the in-use/free flag

pdf won't convert using ghostscript unless i've saved it in acrobat using 'Optimized PDF'

some times ghostscript fails in opening files due to XREF table corruption

try to repair problematic pdf with

pdftk

   http://www.pdflabs.com/docs/install-pdftk/

pdftk file.pdf output fixed.pdf