Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Printing a fillable PDF form with scrolling text fields

Explorer ,
Sep 12, 2018 Sep 12, 2018

Is there a way to show all typed text typed into a scrolling text field when you print a fillable PDF form even if all of the text is not visible on screen (because it extends the text box)?

TOPICS
PDF forms
24.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Sep 12, 2018 Sep 12, 2018

The basic code is something like this:

this.getField("FieldName").textSize = 0;

You can add it under the document's WillPrint event, and then change it back in the DidPrint event.

Regarding my second suggestion: It doesn't have to be a separate file. It can be done using hidden pages that are spawned especially for this purpose and deleted after the file is printed. I've developed similar scripts for some clients in the past so if you're interested in hiring someone to develop it for you, you can contact me via try6767 at gmail.com to discuss it further.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 12, 2018 Sep 12, 2018

You can set the font size to Auto before printing it, or copy it to another location (where there's more place). Either solution will require using a script, though.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 12, 2018 Sep 12, 2018

Do you know the script for "font size Auto?"

My boss is concerned that the type may print incredibly small if it is set to Auto though. This is an employee evaluation form and she says supervisors often have a lot to say

But I'll try it and run it past her.

Is your 2nd suggestion to simply include a 2nd document? If so, she's against that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 12, 2018 Sep 12, 2018

The basic code is something like this:

this.getField("FieldName").textSize = 0;

You can add it under the document's WillPrint event, and then change it back in the DidPrint event.

Regarding my second suggestion: It doesn't have to be a separate file. It can be done using hidden pages that are spawned especially for this purpose and deleted after the file is printed. I've developed similar scripts for some clients in the past so if you're interested in hiring someone to develop it for you, you can contact me via try6767 at gmail.com to discuss it further.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 12, 2018 Sep 12, 2018

Thank you for sharing the code.

The other option sounds intriguing, but I work for a state agency funded by tax payer dollars. I'll run the idea past my supervisor, but I doubt they will be able to outsource this.

Thanks for your help!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 03, 2022 Oct 03, 2022

Where do I put that code?  I filled out a form pdf from the state of Wisconsin and when it chops off the text.  I have Acrobat DCI am pulling my hair out.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 03, 2022 Oct 03, 2022

Where do I put that code?  I filled out a form pdf from the state of Wisconsin and when printed it chops off the text.  I have Acrobat DCI am pulling my hair out.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 03, 2022 Oct 03, 2022

If you want it changed just before the document is printed then under Tools - JavaScript - Set Document Actions - Will Print.

And then under the Did Print event add another code to change it back to its original font size, whatever that may be.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 01, 2025 May 01, 2025

Hello - I also need some guidance. I need to print the contents of the multi line text box. I have edited the javascript as you describe, but it is not working. Not sure how to correct. Please help! Screenshot 2025-05-01 at 10.55.34 AM.pngexpand image

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 01, 2025 May 01, 2025

Do NOT use the Edit JavaScripts command to do this! You can seriously mess up the file if you do.

Only edit it via the Document Actions interface.

The code itself looks fine, but I don't know if the field names you specified are correct. Are there error messages in the JS Console when you use it? Can you share the file with us?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 01, 2025 May 01, 2025

I believe that I used the correct field name since I took it directly from the Field PropertiesScreenshot 2025-05-01 at 11.35.51 AM.pngexpand image

Regarding Javascript, I am working on a MAC. I click on Document Actions and a box appears and is labeled JavaScript Editor.  I click okay and Save. Yet when I print the multiple lines are not showing up.

 

Screenshot 2025-05-01 at 11.57.26 AM.pngexpand image

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 01, 2025 May 01, 2025

I think I now understand what the problem is. Even when I write a smaller font, the box isn't stretching to show the text. What is the script to have the box resize to show all the text?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 01, 2025 May 01, 2025

There isn't such a script. The property only changes the text size, not the box size.

You need to change the size of the text to fit the box, not the other way around. The best option is to use the Auto font size (set textSize to 0 to do that). That will ensure the text fits in the field, unless it's way too long for it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 01, 2025 May 01, 2025

Thank you, I understand. I switched to Auto. Are the Appearance Settings correct for Auto?

 

Screenshot 2025-05-01 at 12.09.49 PM.pngexpand image

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 01, 2025 May 01, 2025

If you have Scroll Long Text enabled then the text will just scroll when it reaches the end of the field, and then some of it might not be visible on the printed copy.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 01, 2025 May 01, 2025

If Scroll Long Text is unchecked will the box grow with the text? I wish there wa a setting to actually set this feature.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 01, 2025 May 01, 2025

No. This is only possible using a very complex script (but it doesn't "push" the rest of the page's contents with it), or if you convert your form to a special kind of PDF file called a Dynamic XFA-Form (but you can't do that with Acrobat).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 01, 2025 May 01, 2025
LATEST

Well thank you anyway. So the bottom line is that faculty who "fill in" this form will only be able to see their extended text with Multi line & Scroll Long Text checked.  I am trying to facilitate ease of review of these forms for faculty, who for the most part are not tech literate. I want to print out the forms and show the contents of the text box for them in a single view.

To print the form for them, I can write the code in Document Print and specify the size to be much smaller.

I should also be able to set properites uncheck Scroll Long Text, set to Auto and the script at 0; but that doesn't want to work (is this correct?)

Any other suggestions? You wrote about a second page. I don't know how to make that work. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 04, 2020 Jun 04, 2020

Hello,

For some reason "auto" is not an option for font size in my drop down menu (undre Appearance). Do you know how to work around that so I can create a text box that will capture all text when printing (avoiding scrolling).

 

Thank you kindly,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2020 Jun 04, 2020

Use the code that's marked as the correct answer for this question.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2020 Feb 05, 2020

Hi,

What is the code for the Did Print field?  Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 06, 2021 Mar 06, 2021

yusufbashir711@gmail.com

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 24, 2024 Apr 24, 2024

Hi there I have multiple feilds that scroll in our document, when I put the willprint event code in I don't know how to make it apply to all 16 feilds. How do I make the code applicable to all of the scrolling feilds? 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 24, 2024 Apr 24, 2024

Duplicate that line of code, once for each field. It's also possible to do it using an array.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 24, 2024 Apr 24, 2024

Thank you! I feel silly, I was leaving out the semi colon between or trying to add them all in a string with commas between in the same line of code duh! Very new to this and appreicate your support on these threads. I'm learning a lot. 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines