Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Breaking a line in dialog box text
  FAQ FAQ  Forum Search   Register Register  Login Login

Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Breaking a line in dialog box text

 Post Reply Post Reply
Author
zhirik View Drop Down
New Member
New Member


Joined: 04 Jun 2013
Points: 32
Post Options Post Options   Quote zhirik Quote  Post ReplyReply Direct Link To This Post Topic: Breaking a line in dialog box text
    Posted: 11 Jun 2013 at 5:36pm
Hi folks,
 
I'm trying to add 2 lines of text to the "name" property of the dialog box element:
...
elements [{
...,
name: "This is the 1st line \n
             This is the 2nd line"
 
....}]
 
However, the \n instruction is not honored. The dialog only displays the 1st line. How can I add this line break? The script does not even like double space between the lines, nor the 'escaped backlash' (\\n).
 
Thank you for your response in advance!Smile


Edited by zhirik - 11 Jun 2013 at 5:38pm
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 11 Jun 2013 at 9:01pm
What type of element is it? And did you set the height property to make sure the second line is visible?
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
zhirik View Drop Down
New Member
New Member


Joined: 04 Jun 2013
Points: 32
Post Options Post Options   Quote zhirik Quote  Post ReplyReply Direct Link To This Post Posted: 12 Jun 2013 at 5:10am
Hi Gilad,

Thanks for your response!

It should just be a static text with OK and Cancel buttons.
I set the width and height of the dialog and the text alignment, but for some reason, the width is ignored and the dialog is too long (I guess it's because the 2nd line of the text stays at the same level as the 1st one (\n is ignored). In addition, although I set the text alignment of the buttons to be centered, they for some reason appear on the right side.

Thank you for your input in advance!
Smile
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 12 Jun 2013 at 8:07am
I was actually referring to the height (and width) settings of the static_text element, actually.
However, if all you have is static text and OK and Cancel button, just use app.alert(). It's MUCH easier to set up, although less flexible in terms of design.
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
zhirik View Drop Down
New Member
New Member


Joined: 04 Jun 2013
Points: 32
Post Options Post Options   Quote zhirik Quote  Post ReplyReply Direct Link To This Post Posted: 12 Jun 2013 at 9:54am
Hi Gilad,
 
Thanks for your suggestion! I would like to replace the app.alert() that I am using in my 'Will Close' action with a dialog box  just because there is no "Cancel" button in app.alert() message windows.
Up until now, my script did not have an option to cancel the app.mailMsg execution, and that's what I would like to add.
So, I created a script that triggers the dialog box and put it as a document-level javascript, just to fine-tune the look&feel of the dialog.
 
Originally posted by try67 try67 wrote:

I was actually referring to the height (and width) settings of the static_text element, actually.
However, if all you have is static text and OK and Cancel button, just use app.alert(). It's MUCH easier to set up, although less flexible in terms of design.
Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 12 Jun 2013 at 10:04am
Sure there is. Look at the reference of that method and you'll see how to implement it.
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
zhirik View Drop Down
New Member
New Member


Joined: 04 Jun 2013
Points: 32
Post Options Post Options   Quote zhirik Quote  Post ReplyReply Direct Link To This Post Posted: 12 Jun 2013 at 10:12am
Hi Gilad,
 
You are right. I overlooked this somehow.Confused
However, what I also need is:
a. Ability to change the default button text (e.g., instead of OK, make it "Send Email")
b. "Commit" operation like in a dialog box that can trigger another action upon clicking OK.
c. Ability to change font.
 
Thank you again for your input!!! Big smile
 
Originally posted by try67 try67 wrote:

Sure there is. Look at the reference of that method and you'll see how to implement it.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.023 seconds.