Expand my Community achievements bar.

Livecycle - Printing Text field

Avatar

Former Community Member
I am new to using livecycle. I have created a form with a multiline text fields. I noticed when the text field is filled in with information and it exceeds the what you can "see" on the screen a scroll bar turns on so you can view the entire inputted text.



My problem is with printing. When the PDF file is filled in and the above situation occurs, it will only print what can be viewed in the text box on the screen. All the other data that you would have to scroll down to see in the electronic file is not printed. Any help is appreciated. Thank you.
13 Replies

Avatar

Former Community Member
There are a number of ways to handle this and it ranges from the simple to the complicated.



1. You can limit the amount of input that goes into the field to the visible area. This way no scroll bars will appear and there will be no area off screen. To do this put focus on the field in question and in the Object/Field palette click on the "Limit Length to Visible Area" checkbox.



2. You can have it so that when a user fills the box the text will shrink to fit the visible area. Put Focus on your field object. Do not limit the length to visible area. In the font palette (if it is not visible hit shift - F4). Make sure that you are only editing the value property. Set the font to 0.



3. Redo the form so that the field will automatically grow when the field is overflowed. The scroll bars will appear when you are typing in th efield put when you leave the field it will grow to accomodate the text. There is an example of doing this in the Purchase Order sample that ships with the product. You will have to redesign your form to build it as a dynamic form. Follow this example if you want this solution. Look in the designer install directory/EN/Samples/Forms/Purchase Order/Dynamic Interactive/Forms



Once you open the form have a look at the Comments field. This is one of those fields. Note only do this technique if you know what you are doing!

Avatar

Former Community Member
I have Designer 7.0 and there is no "Limit length to visible area" checkbox in the object/field palette. There is only "Limit length" and "max char."



Please advise because I would love to limit the length to the visible area without resizing the text option.



Thank you...

Avatar

Former Community Member
Without the "limit length to visible area" option, you can't REALLY do it. My suggestion would be to fill the field in with WWWWWW... until it is full, but not overflowing, count how many chars there are, and set that as your max. I'm pretty sure W is the widest character in most fonts, so if you max it out at how many Ws will fit, it should never really get any bigger.



That's kind of a workaround though. The problem there is if you type anything less than all Ws it will restrict the user before it reaches the edge of the text field.



You could also play with the "Auto-fit" option beneath the Height in the Layout tab. You may be able to make it expand itself downward to fit more text.

Avatar

Former Community Member
Which version of designer are you using. That option was added in recent versions.

Avatar

Former Community Member
I have Designer 7.0. Is there a free update somewhere?

Avatar

Former Community Member
I do not know about the upgrade but in that version you can use an Acroform command to accomplsh the same thing.



To get access to the doc object in Acroform you can use event.doc. The property you want is doNotScroll. So you can code something like this:



var myDoc = event.target;

myDoc.getField("form1[0].Page1[0].Sunform1[0].Field1[0]").doNotScroll = true;



Where the field name in bewteen the quotes is the name as AcroForm woudl see it. This will not allow scroll bars and will limit the user to entering text in the viewable area only.



Another solution is to shrink the text in the visible are so that it all fits. You can do this by making the field multi-ine and having a font size for the Value of the field set to 0. When the field is full the fontsize will reduce so that all text will appear in the visible area. Note that if the user is verbose that you coudl reduce the size of the characters to an unreadable size.

Avatar

Former Community Member
Thank you for this info. I have not used Acroform before. Is this a separate program? Where do I get access to it in LiveCYcle Designer 7.0?

Avatar

Former Community Member
AcroForm is the base technology that PDF uses to make form objects. It has been in Acrobat for some time (version 4 I think). Designer uses a different technology that is XML based called XML Forms Architecture (XFA). That is what you are creating in Designer. When you create a PDF out of an XFA form you are infact turning it into AcroForm technology so Acrobat can display it. The idea was that anythingyou could do with AcroForm woudl be exposed to XFA so that you as a Designer would not have to know or care about which side was being used. Clearly a few things were missed and added over time. There is an Acrobat Javascript reference where this info comes from but I would recommend that you stay in the XFA world and only venture there when absolutely required.

Avatar

Former Community Member
Thank you for that explanation. The one thing I don't understand yet is where to enter the code:



var myDoc = event.target;

myDoc.getField("form1[0].Page1[0].Sunform1[0].Field1[0]").doNotScroll = true;



Please give me the steps of where to put it.



Thanks again for all your help.

Avatar

Former Community Member
In Designer highlight the field that you want to control. In the script editor choose the Initialize event. Make sure that the language dropdown is set to Javascript. Enter the code in the script editor and you are ready to go.

Avatar

Former Community Member
Do I enter the script exactly this way or do I have to change anything?



I tried pasting it into the editor (javascript is showing) and it made no difference.



Thank you.

Avatar

Former Community Member
The code is correct but you must modify it to use your fieldname.

Avatar

Former Community Member

This question was asked 6 years ago. I am having a similar issue myself with a form I have and I am trying to edit so that it will allow users the ability to print what is in the scrollable text field. The text field in my case is limited to 5,000 characters at font 11 and I want it to scroll and I want it to stay at the same font, so the issue is making it print. I know it can be done, I have another form that does exactly what I am wanting in my form. It requires scripting, which I don't know much about. This is part of the scripting that enables the form to print what is hidden:

}

</script>

                  </event>

                  <event activity="prePrint" ref="$host" name="event__prePrint">

                     <script contentType="application/x-javascript">

this.minH="0";

</script>

                  </event>

                  <event activity="postPrint" ref="$host" name="event__postPrint">

                     <script contentType="application/x-javascript">

this.h="7.0527in";

</script>

Perhaps there is more to it above and below this code, but I don't know what that would be, I just know this part of the code is a big part of the script. Anyway, I thought I would share this bit of info in case some genius can use it to help others, I know it is not much and the question is 6 yrs old.