Peter Münster wrote:
> On Thu, Jul 24 2008, Wolfgang Schuster wrote:
> 
>>> Enabling people to view the pdf preview version (limited, containing
>>> excerpts) before acquiring the full version.
>> In this case the solution offered in the thread are no solution for your,
>> it's too easy for the customers to make the hidden content visible.
> 
> Shouldn't it be very easy with MKIV, to replace the content to hide with
> whatever you want?

Yes, pretty easy, but it depends a bit on what you want. Here is a
solution that really removes selected boxes from the output PDF
(it is un-optimised on purpose):

% engine = luatex

\defineattribute [ghosted]

\def\starthidden {\dosetattribute{ghosted}\plusone}
\def\stophidden  {\doresetattribute{ghosted}}

\ctxlua{
callback.register ('pre_output_filter', function (h)
   for v in node.traverse(h) do
      if (
          (
           v.id == node.id('hlist')
           or
           v.id == node.id('vlist')
          )
          and
          (
           node.has_attribute(v,\dogetattributeid{ghosted})
          )
         ) then
       node.free(v.list)
       v.list = nil
      end
   end
   return true
end)
}

> Examples:
> - the replacement are only the corresponding line-skips
> - the replacement are random letters printed in white

You can get those effects by changing the lua loop node.traverse
to do something more interesting (perhaps by recursive descend).

Best wishes,
Taci

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to