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

Acrobate User interface

Community Beginner ,
Aug 29, 2023 Aug 29, 2023

Arjun31926974q4ne_0-1693297193929.png

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();
TOPICS
Cancel subscription , Comment review and collaborate Experiment , Crash or freeze , Create PDFs , Edit and convert PDFs , General troubleshooting , How to , Install update and subscribe to Acrobat , JavaScript , PDF , PDF forms , Print and prepress , Rich media and 3D , Scan documents and OCR , Security digital signatures and esignatures , Standards and accessibility
518
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 ,
Aug 29, 2023 Aug 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.

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 ,
Aug 29, 2023 Aug 29, 2023
LATEST

Read this:

https://www.pdfscripting.com/public/Trust-and-Privilege-in-Acrobat-Scripts.cfm

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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