[DVIPDFMx] the simpleset OCG demo with dvipdfmx possible ?

Alexander Grahn A.Grahn at fzd.de
Wed Mar 11 22:21:13 KST 2009


Hi,

On Wed, Mar 11, 2009 at 02:51:56AM +0900, Matthias Franz wrote:
>On Mon, Mar 09, 2009 at 11:33:05PM +0800, luoyi wrote:
>> I'm trying to create probably the simplest ocg demo files with
>> dvipdfmx now.

What follows is a minimal example demonstrating the generation of
optional content (OCG) with dvipdfm or dvipdfmx

To create the PDF, run tex on it followed by dvipdfm(x).

Kind regards,
Alexander
--

%create new OCG
\special{pdf:obj @ocg <</Type/OCG /Name (myocg)>>}

%register it and configure its default behaviour
\special{pdf:put @catalog <<
  /OCProperties <<
    /OCGs [@ocg]
    /D <</BaseState/ON /Order [@ocg]>>
  >>
>>}

This is a minimal OCG example.

%add the OCG to the resources of the current page object
\special{pdf: put @resources <<
  /Properties <<
    %this maps the name ``oc1'' to the OCG object
    /oc1 @ocg
  >>
>>}

%mark someting of the page content as optional
\special{pdf: content /OC /oc1 BDC} %optional content follows

This text is optional.

\special{pdf: content EDC} %end of optional content

\bye



More information about the dvipdfmx mailing list