Bug 691273

Summary: Watermark problem While converting pdf to jpg files.
Product: Ghostscript Reporter: Murat <muratto12>
Component: PDF InterpreterAssignee: Alex Cherepanov <alex>
Status: RESOLVED FIXED    
Severity: normal CC: alex
Priority: P4    
Version: 8.71   
Hardware: PC   
OS: Windows Vista   
Customer: Word Size: ---
Attachments: patch

Description Murat 2010-04-30 07:35:43 UTC
Hi,

When I want to convert pdf file to jps files, watermark comes to in
front of the text with a very dark color.

Here is an example.
http://www.pdf-to-image-online.com/result.rar

I use windows platform and ghostscriptWrapper.
And the dll version is 8.7.1

The parameters are here.

Os is Windows 2003 Server.

Thank you for any help

                // Keep gs from writing information to standard output
                "-q",
                "-dQUIET",

                "-dPARANOIDSAFER",       // Run this command in safe
mode
                "-dBATCH",               // Keep gs from going into
interactive mode
                "-dNOPAUSE",             // Do not prompt and pause
for each page
                "-dNOPROMPT",            // Disable prompts for user
interaction
                "-dMaxBitmap=500000000", // Set high for better
performance

                // Set the starting and ending pages
                String.Format("-dFirstPage={0}", firstPage),
                String.Format("-dLastPage={0}", lastPage),

                // Configure the output anti-aliasing, resolution, etc
                "-dAlignToPixels=0",
                "-dGridFitTT=0",
                "-sDEVICE=jpeg",
                "-dTextAlphaBits=4",
                "-dGraphicsAlphaBits=4",
                String.Format("-r{0}x{1}", width, height),

                // Set the input and output files
                String.Format("-sOutputFile={0}", outputPath),
                inputPath
Comment 1 Alex Cherepanov 2010-04-30 12:32:00 UTC
This file claims to be %PDF-1.1 but uses transparency.
Ghostscript doesn't check for transparency if it is not supported by
the declared version of the file. Changing the file version to
%PDF-1.5 fixes the problem.

Since old version of PDF are not common now, the check for transparency
is cheap, and mis-labeled files occur occasionally, the version check
will be removed.
Comment 2 Ken Sharp 2010-04-30 12:38:21 UTC
D'oh! Thanks Alex, that explains why extracting a single page with Acrobat and resaving solved the problem....
Comment 3 Murat 2010-04-30 20:26:34 UTC
(In reply to comment #1)
> This file claims to be %PDF-1.1 but uses transparency.
> Ghostscript doesn't check for transparency if it is not supported by
> the declared version of the file. Changing the file version to
> %PDF-1.5 fixes the problem.
> 
> Since old version of PDF are not common now, the check for transparency
> is cheap, and mis-labeled files occur occasionally, the version check
> will be removed.

Thanks you(In reply to comment #2)
> D'oh! Thanks Alex, that explains why extracting a single page with Acrobat and
> resaving solved the problem....

Thank you guys
Comment 4 Alex Cherepanov 2010-05-01 02:00:24 UTC
Created attachment 6244 [details]
patch

Check all PDF files for transparency features because some files have
incorrect version number but Acrobat renders them just fine.

The patch has been committed as a rev. 11162.