Bug 690224

Summary: Unable to add Header and Footer to pdf generated using Ghostscript.
Product: Ghostscript Reporter: Priya Sharma <priya.sharma>
Component: PDF WriterAssignee: Ken Sharp <ken.sharp>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P4    
Version: 8.61   
Hardware: PC   
OS: Windows XP   
Customer: Word Size: ---
Attachments: PS file used to generate PDF
PDF Generated using Active PDF
PDF Generated using Ghostscript
Steps to add Header and Footer using version 7.1.0
Files to which Header and footer needs to be added.
Instructions to Add Page Number
uncompressed, edited exhibit file

Description Priya Sharma 2009-01-09 05:17:21 UTC
We are Creating the pdf which contains some EPS images using Ghostscript.Then 
we try to add Header and footer to the pdf using Documents->Header and Footer-
>Add but its not opening any window.
But when we'll remove the EPS image then its allowing to add that.

Also when we are generating the pdf using Active PDF then we are able to add 
the header and footer to the page.
The size of the pdf generated using Active pdf is some 108 Kb but when we are 
generating using ghostscript its size is 664KB.
Tried to compress the size of the EPS image but still no effect.Is there any 
command option which we have to run to activate to access the Header and 
footer.
Comment 1 Alex Cherepanov 2009-01-09 05:59:21 UTC
Please attach:
1. PS file that was used to generate PDF
2. PDF file generated by your version of Ghostscript
3. PDF file generated by Active PDF
4. Detailed description how you "add header and footer" including
   application names and versions.
Thank you.
Comment 2 Priya Sharma 2009-01-12 00:57:15 UTC
Created attachment 4701 [details]
PS file used to generate PDF

PS file used to Generate PDF
Comment 3 Priya Sharma 2009-01-12 00:58:37 UTC
Created attachment 4702 [details]
PDF Generated using Active PDF

PDF Generated using Active PDF
Comment 4 Priya Sharma 2009-01-12 01:00:13 UTC
Created attachment 4703 [details]
PDF Generated using Ghostscript

PDF Generated using Ghostscript
Comment 5 Priya Sharma 2009-01-12 01:03:49 UTC
After creating the PDf using the ghostscript , we are trying to open the PDF 
in Acrobat Pro version 8.Its allowing to open .But when we are clicking on the 
Document->Header and Footer ->Add its not popping up the window which will 
allow to set the Header and Footer.
But When we are opening the PDF generated by Active PDF in Acrobat Pro its 
popping up the window and allowing to add the Header and footer.
Comment 6 Ken Sharp 2009-01-12 02:14:04 UTC
There is something in the final segment of the page which is causing Acrobat a
problem. If I remove the last block of content then the file can have headers
added with Acrobat 9.

NB the header/footer manipulation can be performed using Acrobat 7 on the
original file, so this is a change in the behviour of Acrobat from version 7.

Having said that, the file content cannot be edited in any version of Acrobat
that I have, and the message when attempting to 'add headeror footer' in Acrobat
9; "An error was encountered while retrieving page content" does suggest
something is wrong with the generated PDF file. The same problem occurs using
HEAD, though the user is using the (rather old) 8.61 version.

It will take some time to reduce the PDF file further to isolate the actual
offending content, and then fix it. 

I don't believe this is a general problem, it seems to be specific to the
content of this job, possibly its related to the enormous amount of metadata
being written using pdfmarks, this information is not present in the file
produced by Active PDF (resulting in a considerably smaller PDF file...)

Comment 7 Priya Sharma 2009-01-18 21:16:13 UTC
Created attachment 4731 [details]
Steps to add Header and Footer using version 7.1.0

Steps to add Header and Footer using version 7.1.0
Comment 8 Priya Sharma 2009-01-18 21:19:36 UTC
Created attachment 4732 [details]
Files to which Header and footer needs to be added.

Files to which Header and footer needs to be added.
Comment 9 Priya Sharma 2009-01-18 21:21:32 UTC
Have added two attachments.We were using 7.1.0 and couldn't add header either.
Did ghost script support test that version of Adobe? We used 8.1.3 and no luck
there either.
Comment 10 Ken Sharp 2009-01-19 08:32:53 UTC
The 'Files to which Header and footer...' attachment is not a PDF file, its a
Zip archive of PDF files...

The 'Steps to add...' attachment is not (or at least does not seem to be) a
plain text file. Its also not a zip archive. So I can't make head or tail of
this one. At 765 KB its rather a large text file.

My tests were done with Acrobat professional 7.0.0, no I didn't test with
Acrobat 7.1.0.
Comment 11 Priya Sharma 2009-01-27 06:07:00 UTC
Created attachment 4760 [details]
Instructions to Add Page Number

I am again attaching the Doc file for the instructions as how we are adding the
 Page Number to the PDF.
Comment 12 Priya Sharma 2009-02-09 22:03:19 UTC
Team,
Since its becoming a critical issue in our project, please send us the update on
this issue or give us the alternate approach to achieve this. 
Your earliest response is highly appreciated. Thanks for your time.
Comment 13 Ken Sharp 2009-02-10 09:10:02 UTC
Priya, Wipro does not appear to be a customer of Artifex, and we need to give
support and development priority to our commercial customers. Your issue has
been recorded, and will be addressed as our schedules permit.

Should you wish to be a supported OEM customer, please contact
Scott.Sackett@Artifex.com
Comment 14 Ken Sharp 2010-08-11 12:47:35 UTC
Created attachment 6642 [details]
uncompressed, edited exhibit file

This does not appear to be a Ghostscript bug. 

The attached PDF file was created from a heavily reduced version of the submitted PostScript file, and was then further edited to remove extraneous objects from the page content stream. The file does still contain an image, a font, and an ExtGState which are not needed, and not used.

The page content stream was reduced to just 5 operations, a gsave, three consecutive graphics state changes, and a grestore.

Removing any one of the three graphics state changes eliminates the problem. The gstate changes are set overprint to true, set the Identity transfer function and finally set overprint to false.

All of these are valid, and as far as I can tell these are valid in this combination.

This therefore would appear to be a bug in Adobe Acrobat.