Skip to main content
Participant
August 29, 2023
Question

Acrobate User interface

  • August 29, 2023
  • 1 reply
  • 629 views

i make the plugin in acrobate , i need to chnage its ui i need black background , instead of top left corner of this that already have javascript window written , i need to chnage and want to remove the last warning javascript window . Overall i want to chnage its ui . 
here is the code 

function createTopMenu() {
  app.addSubMenu({
    cName: "LegalEdge",
    cParent: "File",
  });

  app.addMenuItem({
    cName: "Upload",
    cParent: "LegalEdge",
    cExec: "showUploadDialog()",
  });
}

function showUploadDialog() {
  // Dialog Definition
  var oDlg = {
    usnm: {
      // Define a nested object for usnm
      flnm: "",
      vers: "",
      lfnu: "",
      lccn: "",
    },

    initialize: function (dialog) {
      dialog.load(this.usnm); // Load the nested object directly
    },
    commit: function (dialog) {
      var data = dialog.store();
      this.usnm.flnm = data.flnm; // Access the nested object's properties
      this.usnm.vers = data.vers;
      this.usnm.lfnu = data.lfnu;
      this.usnm.lccn = data.lccn;
    },
    description: {
      name: "Test Dialog",
      elements: [
        {
          type: "view",
          elements: [
            { name: "Filename:", type: "static_text" },
            { item_id: "flnm", type: "edit_text", char_width: 30 }, // Use "flnm" instead of "usnm.flnm"
          ],
        },
        {
          type: "view",
          elements: [
            // Add a view for the vers field
            { name: "Version:", type: "static_text" },
            { item_id: "vers", type: "edit_text", char_width: 30 }, // Use "vers" instead of "usnm.vers"
          ],
        },
        {
          type: "view",
          elements: [
            // Add a view for the lfnu field
            { name: "LegalEdge File Number:", type: "static_text" },
            { item_id: "lfnu", type: "edit_text", char_width: 30 }, // Use "lfnu" instead of "usnm.lfnu"
          ],
        },
        {
          type: "view",
          elements: [
            // Add a view for the lfnu field
            { name: "LegalEdge Court Case Number:", type: "static_text" },
            { item_id: "lccn", type: "edit_text", char_width: 30 }, // Use "lfnu" instead of "usnm.lfnu"
            { type: "ok_cancel" },
          ],
        },
      ],
    },
  };

  // Dialog Activation
  oDlg.usnm.flnm = "Larry";
  oDlg.usnm.vers = "1.0";
  oDlg.usnm.lfnu = "Sample";
  oDlg.usnm.lccn = "Sample2";

  if ("ok" == app.execDialog(oDlg)) {
    app.alert(
      "flnm: " +
        oDlg.usnm.flnm +
        "\nvers: " +
        oDlg.usnm.vers +
        "\nlfnu: " +
        oDlg.usnm.lfnu +
        "\nlfns: " +
        oDlg.usnm.lccn
    );
  }
}

createTopMenu();
This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
August 29, 2023

> black background

Not possible.

 

> javascript window written ... remove the last warning javascript window .

In order to do both of these things you'll have to run the code from a privileged context, such as a trusted function in a folder-level script.

Thom Parker
Community Expert
Community Expert
August 29, 2023
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often