From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/42769 Path: news.gmane.org!not-for-mail From: Taco Hoekwater Newsgroups: gmane.comp.tex.context Subject: Re: hiding content Date: Sun, 27 Jul 2008 14:26:22 +0200 Message-ID: <488C696E.4040701@elvenkind.com> References: <326847810807240351g5ad3fb5bs630f893ff3d73cc9@mail.gmail.com> <326847810807240534t3033b46bhc728e49c9402e8da@mail.gmail.com> <115224fb0807240603j6dd8a4e0rdf361e5b33d74c83@mail.gmail.com> <326847810807240621s33ee5555gc4e6024e00528cd2@mail.gmail.com> <115224fb0807240632o5665794j7a3848ecfcf91b19@mail.gmail.com> <20080724194307.GA18010@gaston.couberia.bzh> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1217161698 28963 80.91.229.12 (27 Jul 2008 12:28:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Jul 2008 12:28:18 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Jul 27 14:29:08 2008 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1KN5Mz-00005X-JR for gctc-ntg-context-518@m.gmane.org; Sun, 27 Jul 2008 14:29:01 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B080D1FCD0; Sun, 27 Jul 2008 14:28:05 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 00380-01-9; Sun, 27 Jul 2008 14:27:14 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9D9531FC7A; Sun, 27 Jul 2008 14:27:10 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 79E3D1FC7A for ; Sun, 27 Jul 2008 14:27:06 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 00380-01-8 for ; Sun, 27 Jul 2008 14:26:30 +0200 (CEST) Original-Received: from smtp-vbr7.xs4all.nl (smtp-vbr7.xs4all.nl [194.109.24.27]) by ronja.ntg.nl (Postfix) with ESMTP id 6D8111FB7F for ; Sun, 27 Jul 2008 14:26:28 +0200 (CEST) Original-Received: from [10.10.0.6] (boo.demon.nl [82.161.175.147]) (authenticated bits=0) by smtp-vbr7.xs4all.nl (8.13.8/8.13.8) with ESMTP id m6RCQNZO040985 for ; Sun, 27 Jul 2008 14:26:28 +0200 (CEST) (envelope-from taco@elvenkind.com) User-Agent: Thunderbird 1.5.0.10 (X11/20070305) In-Reply-To: <20080724194307.GA18010@gaston.couberia.bzh> X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:42769 Archived-At: Peter M=FCnster 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 =3D 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 =3D=3D node.id('hlist') or v.id =3D=3D node.id('vlist') ) and ( node.has_attribute(v,\dogetattributeid{ghosted}) ) ) then node.free(v.list) v.list =3D 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 t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________