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