Hi, If one tries to re-use existing XObjects, that were created using /BP & /EP pdfmarks, within another XObject to be created using a /BP-/EP pdfmark pair, the resulting container XObject lacks the /XObject <<...>> entry in its /Resources dictionary. Consequently, when loading the PDF into AdobeReader, an error message such as ``Could not find the XObject named '/R9'.'' is raised. I would like to make use of this feature in order to create OCG (PDF-Layer) based animations. The container XObject could be used as an `Appearance' for some Widget Annotation, such as a button, that can have an animated visual appearance. Please see the attached PS file. Although somewhat trivial, it illustrates the main idea. If distilled using AcobatDistiller, the child XObjects of the container XObject can be hidden and unveiled using the `Layers' panel in AdobeReader. Best regards, Alexander Grahn
Created attachment 3989 [details] Nesting /SP into /BP-/EP pdfmarks example Ps2pdf converts this file without error message. However, AdobeReader raises an error message when reading it. If converted with AcrobatDistiller, the resulting PDF is ok. If opened in AdobeReader, the visibility state of child XObjects of the container XObject can be changed using the `Layers' panel.
Bug still reproducible in Ghostscript 9.03
I think this is a duplicate of 689883, in any event the file seems to work correctly with current code(since commit ca3d544d51c3e1d63a2fd115dac23255c966ba0e)