Dynamic Stamp / Problem with Design Dialogbox

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

Nimrod_189
User
Posts: 61
Joined: Wed Sep 23, 2009 8:39 am

Dynamic Stamp / Problem with Design Dialogbox

Post by Nimrod_189 »

Hi Guys,

I created a dynamic stamp and it works fine.

However, there is a small blemish and I would like to have the OK button centered. But I just can't do it.

I hope someone has an idea how I can do it.

Here is my Dialogbox.
Screenshot 2022-04-10 105146.png
And here is the code:

Code: Select all

if (event.source.forReal && (event.source.stampName == "#n2h6j4ssD6YLY7bvr2CUh2")) {

var dialog = {
  
    retErledigt: "",
    DateValue: "",
	
  initialize: function(dialog) {
       //dialog.load({"raA3": true}); // option A3 is default
       //Textfeld "txt1" erhält den Standardtext (aktuelles Datum)
       var todayDate = dialog.store()["date"];
       todayDate = util.printd("dd.mm.yy", new Date());
	  dialog.load({"txt1": todayDate});
         dialog.load({"txt2": 1});		
    },

    //Speichern der Werte aus dem Custom-Dialog in den Dialog-Variablen
    //siehe hierzu den Header
    commit: function (dialog) { // called when OK pressed 
      var data = dialog.store();

		 this.DateValue = data["txt1"],
	        this.SeitenValue =data["txt2"];

    },

    description:
    {
        name: "Faxstempel",    // Dialog box title
        elements:
            [
                {
                    type: "view",
		      align_children: "align_top",
                    elements:
                        [
							{
                                name: "Datum: ",
                                type: "static_text",
				     width: 50,
  		
                            },

                            {
                                item_id: "txt1",
                                type: "edit_text",
                                multiline: false,
				    bold: true,
                                width: 80,
                                height: 20
                            },
            			
                        ]
                },


 {
                    type: "view",
		      align_children: "align_top",
                    elements:
                        [
           			
							{
                                name: "Seiten: ",
                                type: "static_text",
				    width: 50,
  		
                            },

							{
                                item_id: "txt2",
                                type: "edit_text",
                                multiline: false,
				    bold: true,
                                width: 80,
                                height: 20
                            },                          
  
 
                        ]
                },

{
                    type: "view",
			
		      align_children: "align_center",
                    elements:
                        [
           			
{
                                type: "ok",
                                ok_name: "Ok",
                            },   
  
 
                        ]
                },

            ]
    }
}


//if (event.source.forReal && (event.source.stampName == "#caseandnumblue")) {
if ("ok" == app.execDialog(dialog)) {



//aktuelles PDF-Formfield erhält den Wert
event.value = dialog.SeitenValue;

//Windows Login-Name

//Zwischenspeichern des Textfeld mit dem Datum
var d;
    d = dialog.DateValue
    d = d.replace( /,/g, "." );
    d = d.replace( /\//g, "." );
   //app.alert(d) 

//Konvertierung String d in cDate
var cDate = util.scand("dd.mm.yy", d);

//PDF-Formfield mit neuem Wert befüllen und Datum richtig formatieren
this.getField("txtDate").value=util.printd("dd.mm.yy", cDate);

}

}
I hope anyone can help me.

Thanks.

Nimrod
You do not have the required permissions to view the files attached to this post.
lev
User
Posts: 280
Joined: Fri Apr 11, 2014 1:18 am

Re: Dynamic Stamp / Problem with Design Dialogbox

Post by lev »

Try replacing lines 83 - 97 with

Code: Select all

{

alignment: "align_center",
type: "ok",
ok_name: "Ok",

}
Nimrod_189
User
Posts: 61
Joined: Wed Sep 23, 2009 8:39 am

Re: Dynamic Stamp / Problem with Design Dialogbox

Post by Nimrod_189 »

Thank you for your help, but unfortunately it doesn't work.

Since it is just a blemish, I will not pursue it further.

Nevertheless many thanks.
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11036
Joined: Wed Jan 03, 2018 6:52 pm

Re: Dynamic Stamp / Problem with Design Dialogbox

Post by Daniel - PDF-XChange »

Hello, Nimrod_189

I am afraid that if Lev's suggestion there did not work, I do not have anything better to offer either. Hopefully it is, as you say, simply a visual blemish and can be ignored. I am sure with a bit more JS knowhow it could be done, but I am not that fluent.

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Nimrod_189
User
Posts: 61
Joined: Wed Sep 23, 2009 8:39 am

Re: Dynamic Stamp / Problem with Design Dialogbox

Post by Nimrod_189 »

Many thanks for the help.

My problem isn't that important either, so that's done for me now.

Nimrod
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11036
Joined: Wed Jan 03, 2018 6:52 pm

Re: Dynamic Stamp / Problem with Design Dialogbox

Post by Daniel - PDF-XChange »

Hello, Nimrod_189

Understood, have a nice day!
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com