Toggle PDF Layers (OCGs)

Discussion in 'Mac Programming' started by superscape, Jul 31, 2014.

  1. superscape macrumors 6502a

    superscape

    Joined:
    Feb 12, 2008
    Location:
    East Riding of Yorkshire, UK
    #1
    Hi,

    I need to be able to toggle a layer on/off in a PDF - easy enough in Acrobat using JavaScript... However, the catch is that I need to be able to toggle the layer *without* opening the file.

    The best I can think of is a fudge using Ghostscript to make a document level Javascript to run when the document is open but that seems scruffy. I don't see anything useful in CGPDF (Obj-C) or on the command line (pdftk)

    It seems such a basic thing, but I'm drawing a blank. Does anyone have any ideas?

    Thanks!

    Rob
     
  2. superscape thread starter macrumors 6502a

    superscape

    Joined:
    Feb 12, 2008
    Location:
    East Riding of Yorkshire, UK
    #2
    ...and my Ghostscript fudge doesn't work because pdfwrite trashes the layers! Grrr...
     

Share This Page