[javascript FR] app.dialog code format edit_text

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

User avatar
Mathew
User
Posts: 945
Joined: Thu Jun 19, 2014 7:30 pm

[javascript FR] app.dialog code format edit_text

Post by Mathew »

There's a multiline setting for edit_text boxes in the custom dialog, and the text in it is proportional:
image(1).png

I'm looking for (maybe a non-documented parameter or a new one :wink: ) that would show the text in a proportional monospaced font (and maybe line numbers and colored!) like the javascript console (or as implemented in the code tag in this forum):
image.png
You do not have the required permissions to view the files attached to this post.
Last edited by Mathew on Fri Nov 13, 2026 4:32 pm, edited 1 time in total.
User avatar
Sean - PDF-XChange
Site Admin
Posts: 1421
Joined: Wed Sep 14, 2016 5:42 pm

Re: [javascript FR] app.dialog code format edit_text

Post by Sean - PDF-XChange »

Hi Mathew, thanks for the post.

Could you please clarify a couple of things here:

1. What is the upper dialog box in your post, and where can we find it?
2. When you mentioned 'proporional font' - I believe you mean monospaced font, can you please confirm?

Kind regards,
Sean Godley
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
User avatar
Mathew
User
Posts: 945
Joined: Thu Jun 19, 2014 7:30 pm

Re: [javascript FR] app.dialog code format edit_text

Post by Mathew »

Sean - PDF-XChange wrote: ↑Fri Nov 13, 2026 4:20 pm 1. What is the upper dialog box in your post, and where can we find it?
2. When you mentioned 'proporional font' - I believe you mean monospaced font, can you please confirm?
Hi Sean,
  1. The screenshot is from a tool for javascript snippets posted here: viewtopic.php?t=49412
    but here's some simple code that demonstrates it:

    Code: Select all

    /** demo of multiline app.dialog box
    **/
    
    function demoMultiline() {
      /* dialog object */
      const dia = {
        initialize(dialog) {
          // pre-load some code, for demonstration
          dialog.load({
            'inpt': demoMultiline.toString()
          });
        },
        description: {name: "Sample dialog", first_tab: 'okbt', elements: [
          {type: 'static_text', name: "Mathew hopes for a parameter that would format text as code (or in a monospaced font)", width: 400},
          {type: 'edit_text', item_id: 'inpt', multiline: true, width: 400, height: 300},
          {type: 'ok', item_id: 'okbt'}
        ]}
      };
      /* run custom dialog */
      return app.execDialog(dia);
    }
    
    demoMultiline();
  2. Oops -- typo. Yes, 'monospaced font' is what I'm looking for; corrected in my post above.
I'm hoping that, because it's already implemented in other dialogs for PDF-XChange, that it wouldn't be a heavy lift for the developers. I'm also thinking that if it were a separate parameter (ie code = true) then it wouldn't affect how javascript works for other applications, but would result in improved experience in PDF-XChange.

Thank you for looking into this.
Mathew.
User avatar
Sean - PDF-XChange
Site Admin
Posts: 1421
Joined: Wed Sep 14, 2016 5:42 pm

Re: [javascript FR] app.dialog code format edit_text

Post by Sean - PDF-XChange »

Hi Mathew,

Thanks for the clarification - I have passed your request on to the development team for review.

Kind regards,
Sean Godley
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
User avatar
Sean - PDF-XChange
Site Admin
Posts: 1421
Joined: Wed Sep 14, 2016 5:42 pm

Re: [javascript FR] app.dialog code format edit_text

Post by Sean - PDF-XChange »

Update—a ticket has been made in relation to this feature request:

#7991: FR: Enhancements for Text Elements in Custom JavaScript Dialogs Boxes

Kind regards,
Sean Godley
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623