Bug 696167 - Missing forms data when using pdfgetpage/pdfshowpage
Summary: Missing forms data when using pdfgetpage/pdfshowpage
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: master
Hardware: PC Windows XP
: P1 normal
Assignee: Ken Sharp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-26 09:31 UTC by Marcos H. Woehrmann
Modified: 2015-08-26 09:58 UTC (History)
1 user (show)

See Also:
Customer: 780
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2015-08-26 09:31:31 UTC
The customer reports and I've verified that when pdfgetpage/pdfshowpage are used to display a PDF file portions of the rendered page are missing.

Here are the steps to duplicate the problem:

in a windows command prompt run 

  "\Program Files\gs\gs9.17\bin\gswin32c.exe" -sDEVICE=display

at the GS prompt:

  /PDFfile (form1SM.PDF) (r) file def
  PDFfile runpdfbegin
  2 pdfgetpage pdfshowpage

The page is displayed with all of the form data missing.


If the following command is entered at the GS prompt instead:

  (form1SM.PDF) run

when (return) is pressed to go to the second page the data is present.


A likely significant difference between the two operations is that the "(form1SM.PDF) run" produces several error messages:

  **** Warning: Tf refers to an unknown resource name: ArialMT Assuming it's a font name.

The missing content is all Arial (the rest of the page is ArialBold).
Comment 2 Chris Liddell (chrisl) 2015-08-26 09:56:01 UTC
The problem is that the sequence shown above doesn't initialize various parts of the PDF interpreter code (like option content handling and Acroform handling).

So, you need to add in a process_trailer_attrs call, thus:

  /PDFfile (form1SM.PDF) (r) file def
  PDFfile runpdfbegin
  process_trailer_attrs
  2 pdfgetpage pdfshowpage


For me, that shows the page properly.