I have a PDF document with a single paragraph blurb in it that needs to be excluded or included depending on the context. After spending some time looking around I couldn't find any way to set a static text block to hidden. That being so, I considered possibly having the context exist as a textfield that I simply set or unset when the document is filled in by my ASP.NET application. This option would work, but it cause me to lose the formatting of the text as it now (which isn't something I want to do).
Is there any graceful way to turn a block of text on or off dynamically? If not, are there any hacks that would produce a similar result?
Thanks!
But you can also group the text into an OCG layer which can be turned on and off with JavaScript. There are a couple of 3rd party tools for adding OCGs to a PDF, like a Aerialist from www.artspdf.com ( I think Callas has one too). But you can also do this by putting the optional text in a separate PDF and then overlayng that PDF onto your main document by adding it as a watermark. Here is an article on createing and using OCGs in Acrobat JavaScript.
http://www.acrobatusers.com/tutorials/2006/create_use_layers
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script