Operating System : Linux Suse 8.1 Ghostscript Version : 8.0 / 8.14 Problem I am trying to convert PDF to Tiff in Linux using AFPL ghostscript 8.0. The output tiff is missing form fields of input PDF. Also I tried the lattest AFPL ghostscript 8.14. I got the same result About PDF File *************** The PDF file is having an acroform with fields defined. The form has the flag called "NeedAppearances" set to true. And It does not define any stream( even Normal streams) for these fields. PDF Spec 1.4 says if this flag is true, the viewer application has to constuct a stream. I have the doubt that if Ghostscript handles this case. It is a production and very urgent problem. Any suggestions are appreciated. Is there any workaround to overcome this problem. Herewith I have attached the sample. Thank you Regards Mathi
Created attachment 699 [details] sample pdf giving problem
Ghostscript doesn't handle this, nor does xpdf. This is an enhancement that we may get to some day. If someone wants to pay for the development of this feature, we will do this, since it may be useful to others.
The action that is needed for this case (/Tx == Text Field) is: for each object in the Annots entry of the /Page object if Annot, SubType Widget has a /Parent that is a member of the Fields object of the AcroForm object of the Catalog, then Display the /V (value) text using the /DA (default appearance) setup to the graphics state General handling of other /FT values such as /Btn == button, /Ch == Choice and /Sig == Signature require different handling. I haven't investigates these. This is an extension to the /drawannot procedure defined in lib/pdf_draw.ps and probably isn't too terribly difficult for someone knowledgeable about the PDF interpreter implementation such as myself or Alex (alexcher@coscript.com).
Created attachment 1615 [details] patch Ray, This is a 1st version of the fix. Please review the general structure of the program, such as formatting the text in a new text rendering operator. Although the customer's file renders identically to Adobe Acrobat, there are many things that are not yet coded. 1. Other types of annotations 2. XML formatting 3. Multi-line text fields 4. Combed text fields 5. Right-aligned or centered text with non-0 word and character spacing 6. Automatic font size selection Item 6 causes incorrect rendering of the sample file attached to this bug bug 587498.
The patch mainly good except few minor things. 1. Please replace dash with underscore in names according to Ghostscript tradition. 2. Not clear why undef is applied to draw-terminal-field-dict and isn't applied to draw-form-field, draw-terminal-field. If it doesn't cause a regression, please commit with minor changes and with qouting Comment #4 in the log message. Assigning the bug to Alex since Ray passed it to me.
An improved path that supports automatic font size selection has been committed as rev. 7878. The sample file now renders correctly. Ghostscript generates many warnings that indicate real problems with the file: - 0 text size is permitted in the AcroForm fields but not in regular anniotations. - The file has unbalanced Q and q operators.