These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How to make an option not occupying any space when printed if not selected

Kevin0369
Registered: Apr 10 2011
Posts: 2
Answered

Hello,
I'm trying to make a form which should be like this:
 
this is what users can see on screen:
□1.option1
■2.option2
□3.option3
next line...
 
when printed it should be like this:
■2.option2
next line...
 
I want to use javascript on every single checkbox's change event to complete this task, however presence options:"Visible (Screen Only)" still occupy space when printed, so when printed it will look like:
 
■2.option2
 
next line...
 
And I can not switch between "Visible" and Visible (Screen Only)" very well, this is my code:
 
form1.CheckBox1::change - (JavaScript, client)
if (this.rawValue == "1") {
this.relevant = "+print";
}
 
if (this.rawValue == "0") {
this.presence = "visible";
this.relevant = "-print";
}
 
The checkBox will become "Visible (Print Only)" when checked, not "Visible".
Any suggestion or reference will help, thank you.

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Accepted Answer
Hi,

when you use the relevant property, the form object isn't removed only bypassed for the printing, but the space it uses in the layout is still there.
You should use the presence property combined with a flowing layout to control the form.

  1. rm1.CheckBox1::prePrint - (JavaScript, client)
  2. if (this.rawValue == "1") {
  3. this.presence = "hidden";
  4. xfa.layout.relayout();
  5. }
  1. rm1.CheckBox1::postPrint - (JavaScript, client)
  2. this.presence = "visible";
  3. xfa.layout.relayout();

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Kevin0369
Registered: Apr 10 2011
Posts: 2
The form acts perfectly, thank you!