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

Easy Rich Text Formatting in Acrobat

BAWD001
Registered: Jan 21 2009
Posts: 47
Answered

I'd like to include a scrollable, multi-line, rich text User Guide to my Online PDF form complete with bold headers, bulleted and plain text. It would be made accessible with a button that shows/hides the User Guide text content (temporarily overlaying existing form content).

I was hoping I could simply cut and paste the rich text content into a Text field (from MS-Word) but pasting removes the "rich" content characteristics (eg. bolding etc.) even with the Text field's "Allow Rich Text Formatting" option selected.

What would be the simplest way to include this rich text User Guide? Can I imbed special control characters in the text that would change bolding and other rich text formatting? If so, is there an online guide with a list of those features?

- or - does the User Guide content have to be painstakingly Javascript-coded ... line by line ... perhaps in the User Guide Text field's Custom Formatting script?

My Product Information:
Acrobat Standard 9.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
I just did a test using Acrobat 9 Pro and both Word and WordPad, and rich text copied (Ctrl + C) from both those programs pasted (Ctrl + V) correctly in a rich text field in Acrobat 9. So this could be something related to your setup. Are you able to try it using a different machine?

George
BAWD001
Registered: Jan 21 2009
Posts: 47
I use Acrobat 9 Standard and pasting rich text (Ctrl + C) into the Options-Default Value: for the text field yeilds the bad result ... unformatted text. I've copied from both an MS-Word 2002 document as well as a RTF file from Word Pad v6.0 (latest version) with the same result ... pasting rich text into the Default Value yields unformatted text.

Am I pasting in the wrong place (eg. "Options-Default Value" property for the text box field)?

Do I need the Pro version of Acrobat 9 to do this?

I don't have access to another installed version of Acrobat 9 Standard on another PC to do another test but I don't think that's the problem.

Please advise.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
I see. It makes sense that you would want to paste rich text as the default value, but it doesn't work, as you've found. What I was did was paste it in the field, so it displayed correctly. But if the field were to get reset, you'd lose it.

It would be possible to use JavaScript to get the rich text value of a field and automatically build the code that you'd need to restore the field contents when needed, but that would take a bit of work.

George
BAWD001
Registered: Jan 21 2009
Posts: 47
When you say "What I did was paste it in the field, so it displayed correctly", how exactly are you doing that if not pasting it into the Default Value for the text field?

If I can get the rich formatted text displaying as the content of an optional visible text field I think I'd be OK (i.e. no need to "reset" that content, as you mention, for any reason I can think of). If not, I'm not sure what the "Allow Rich Text Formatting" option for Acrobat text fields actually does.

I agree that using Javascript to build the text would be more work than could be justified for the project.

I guess if there's no other option, I'll be forced to have same font-size, non-bolded, black-only text ... not very attractive or readable for an online form User Guide. I'm guessing adding graphic components to that scrollable multi-line text field would be right out of the question.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Just as an end user would enter text into a field. In your case, you most likely want the field to be read-only, so you'd have to first make the field not -read-only, paste your rich text into the field, and make it read-only again.

George
BAWD001
Registered: Jan 21 2009
Posts: 47
Thanks George.

That'll make it relatively straightforward for me to create a well-formatted, visually interesting User Guide.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
I just realized that of you make the field read-only, the user won't be able to scroll...

Another approach is to make a PDF out of your Word document and use a button to display the pages. If you'd like more information, post again.

George
BAWD001
Registered: Jan 21 2009
Posts: 47
Using the techique you mentioned (i.e. create a multi-line text field that allows rich text content and is not read-only, paste rich text in preview mode, then set the field to be read-only) I can indeed actually scroll the rich content. You have to click on the text box (eg. put it in focus) to make the scrollbar show up.

Is there a way to put that text field into focus automatically (i.e. so the scrollbar shows up right away)? I'm thinking something in Javascript on the Action-Mouse Up trigger for the "User Guide" display button that makes the User Guide text field visible.

Your comment on making the content into a PDF then displaying as a button is intriguing (would allow for graphics as well rich text I'm assuming). You mention this would "display the pages" which makes me assume your technique would be a "page" structure and not a scrollable content box structure of some kind (eg. a scrollable text field).

I prefer scrollability but, as mentioned above, would like the scrollbar to show up when the content is displayed.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Hmm...a read-only field should not be able to receive the focus. What you're describing does not work for me.

Regarding using a button to display the content, it can indeed have graphics and it would be more page oriented, although it is possible to set it up so that you can have a long scrollable page as well. It gets more complicated (and harder to describe), but it's possible. If you're interested, I can provide a sample if I can manage to find it...

George
BAWD001
Registered: Jan 21 2009
Posts: 47
It does seem counter-intuitive that a read-only field can get focus, doesn't it?

However, I'm guessing because it is a multi-line text field with more text than can fit into the onscreen text box, it show a small plus sign "+" in the bottom right corner that indicates more text exists in the text field being displayed. By simply clicking on the text box (anywhere), the scrollbar appears on the right side and all the rich text content is available for viewing. Indeed, imbedded web links, that have to be scrolled down to in the pasted content, are accessible and work fine. Clicking anywhere else on the form, reverts back to displaying the "+" in the bottom right corner of the text box.

Still, it would be nice if the scrollbar would show up immediately.

If the field was not read-only, how would you have approached setting focus to that field, or is that even possible?

As for your button solution, I would certainly be interested in a PDF sample that uses a button as a PDF holder. It may well work better than a text field solution.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Are you sure the field is read-only?

Here's a simple demo that demonstrates the basic idea: [url=https://share.acrobat.com/adc/document.do?docid=fb49421d-63ff-4fd6-af04-49895633b286]Scrollable Viewport Demo[/url]

If you have any questions, post again.

George
BAWD001
Registered: Jan 21 2009
Posts: 47
I've uploaded a simplified sample of a rich text, multi-line, scrollable, read-only text field PDF I've been describing, to my website at:

[url=http://www.broodingartist.com/Readonly_Scrollable_Text_Field.pdf]Readonly Scrollable Text Field[/url]

I'll only leave it online for a short time but I just wanted to show that a readonly, multi-line, rich text field can have focus set to it by clicking on it and be scrollable as a result.

RE: Scrollable Viewport Sample
Thanks for showing me this George. Given that I still don't know if it's feasible or viable to programmatically set focus to my scrollable text box (to make the scrollbar appear by default) I may look into using the viewport technique.

Looking at the form, where does the vp_obj get defined? I have Acrobat 9 Standard and am unsure of where to find the definition of that object (I assume it's not defined at the field level). I can see the Javascript code for the up, down, Page 1 and Page 2 buttons, but they all refer to setting properties for the vp_obj (eg. vp_obj.vpScroll(10);). Will I need to upgrade to Acrobat 9 Pro to access that object (I understand Acrobat 9 Pro allows you to define objects at the document level rather than just the field level as in Acrobat 9 Standard) or is there something I'm missing?

Thanks for all your insight on this George.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Thanks for the sample. It does not work for me as as you're describing though. I'm surprised that it does work like that for you. If I were in your place, I'd check various other installations to make sure it behaves for others as you expect it to.

And yes, in the sample I posted, almost all of the code is in a document-level JavaScript. I don't have Standard, but I seem to recall that it does not allow you to create/view document-level code, which if true is a silly, pointless, and counterproductive restriction. That is where most of your code SHOULD be.

George
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Now I see what you mean. Note that it only behaves the way you describe if viewed in Preview mode in Acrobat. I think the fact that it does should be considered a bug. It does not behave that way when viewed normally.

George
BAWD001
Registered: Jan 21 2009
Posts: 47
I tried accessing my scrollable readonly sample with an older PC and its Acrobat 7 reader and it did not show the scrollbar when clicked on. Upgrading that PC to the Acrobat 9 reader fixed the problem but that tells me it's not a viable solution (not everyone upgrades as often as I do).

Soooo, I guess if I want to implement a scrollable User Guide on this form I'll have to upgrade to Acrobat 9 Pro to do the PDF viewport thing .... that or limit my User Guide to fit on one page.

I agree that Acrobat 9 Standard should definitely have access to create document level Javascript. I believe previous Acrobat Standard versions allowed it but Adobe must have seen it a way to grab more cash with upgrades. Alas.

Anyway, if I pursue this, I'll likely have to pay up.

Thank for all your help George.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Quote:
I believe previous Acrobat Standard versions allowed it but Adobe must have seen it a way to grab more cash with upgrades.
I don't think previous versions of Standard did either, and there was less of a need. Adobe has provided a lot more functionality with Acrobat 9 Standard, such as creating forms and Reader-enabling forms, so they've actually been quite generous. But it doesn't make sense to allow you create forms and do programming, while not allowing you to follow best practices while doing so. The sentiment is probably along the lines of "Real forms work and programming should be done in Pro", but this particular restriction is still silly.

George