Hi XChange community,
I want to use dynamic stamps with editable fields. So I added a text field to my stamp in the edit-mode. The automated field like 'current date' work perfectly with java script.
Now, I want to create a text field the user can (or better must) fill on his own by using a simple STRING (e.g. 'source of the document'). In the best case the stamp would pop up after it is added to a document.
Is this even possible? It seems like it does not matter which property I change - the stamp keeps uneditable.
Thank You!
Haemte
How to write in dynamic stamps
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
- Patrick-Tracker Supp
- Site Admin
- Posts: 1645
- Joined: Thu Mar 27, 2014 6:14 pm
- Location: Vancouver Island
- Contact:
Re: How to write in dynamic stamps
Hello Haemte,
Thank you for the post. I am afraid that it is not possible. Once the stamp is applied, the text fields are no longer form fields. The Date insertion works because it is auto-evaluated before the stamp is committed.
Cheers!
Thank you for the post. I am afraid that it is not possible. Once the stamp is applied, the text fields are no longer form fields. The Date insertion works because it is auto-evaluated before the stamp is committed.
Cheers!
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.
Cheers,
Patrick Charest
Tracker Support North America
Thank you.
Cheers,
Patrick Charest
Tracker Support North America
Re: How to write in dynamic stamps
Hello.
You can add text to your stamp before it is applyed to your document.
See the attachement.
Kindly regards
Frans
You can add text to your stamp before it is applyed to your document.
See the attachement.
Kindly regards
Frans
- Paul - Tracker Supp
- Site Admin
- Posts: 6897
- Joined: Wed Mar 25, 2009 10:37 pm
- Location: Chemainus, Canada
- Contact:
Re: How to write in dynamic stamps
Thanks Frans - very cool!
Haemte, you will need to know some JavaScript to do this yourself:
https://www.pdfscripting.com/public/Fre ... cfm#Stamps
https://www.pdfscripting.com/public/All ... Stamps.cfm
I hope that helps.
Haemte, you will need to know some JavaScript to do this yourself:
https://www.pdfscripting.com/public/Fre ... cfm#Stamps
https://www.pdfscripting.com/public/All ... Stamps.cfm
I hope that helps.
Best regards
Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Re: How to write in dynamic stamps
Frans,
can you send my the script voor a random text field. not sure what the stampname is. is that the file name of the stamp?
var cAsk = "Enter Exhibit Number" ;
var cTitle = "Exhibit Number: ";
if(event.source.forReal && (event.source.stampName == "#NeBeYUvp04_DiMyVZWil5D"))
{
var cMsg = app.response(cAsk, cTitle);
event.value = cMsg;
event.source.source.info.exhibit = cMsg;
}
gr Ralf
can you send my the script voor a random text field. not sure what the stampname is. is that the file name of the stamp?
var cAsk = "Enter Exhibit Number" ;
var cTitle = "Exhibit Number: ";
if(event.source.forReal && (event.source.stampName == "#NeBeYUvp04_DiMyVZWil5D"))
{
var cMsg = app.response(cAsk, cTitle);
event.value = cMsg;
event.source.source.info.exhibit = cMsg;
}
gr Ralf
- Ivan - Tracker Software
- Site Admin
- Posts: 3549
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
- Contact:
Re: How to write in dynamic stamps
Every stamp has a unique ID (this ID is automatically generated when a new stamp is added into a collection).
this code
ensures that the UI is shown when:
a) stamps is being placed on a document (checking event.source.forReal property), but not just displaying in stamps palette;
b) it ensures that exactly required stamp is being placed, checking an ID of the stamp. That's required because dynamic stamps utilize form calculation event to update fields content, and that event is fired for all fields, but we have to show UI only when our field is being placed.
Here is small sample that shows a dialog with one custom text box:
HTH
this code
Code: Select all
if(event.source.forReal && (event.source.stampName == "#NeBeYUvp04_DiMyVZWil5D"))
a) stamps is being placed on a document (checking event.source.forReal property), but not just displaying in stamps palette;
b) it ensures that exactly required stamp is being placed, checking an ID of the stamp. That's required because dynamic stamps utilize form calculation event to update fields content, and that event is fired for all fields, but we have to show UI only when our field is being placed.
You will have to define your dialog and show it. Please referer to PDF JS documentation to find out more information about dialogs in JS.can you send my the script voor a random text field.
Here is small sample that shows a dialog with one custom text box:
Code: Select all
f(event.source.forReal && (event.source.stampName == "#NeBeYUvp04_DiMyVZWil5D"))
{
// Dialog Definition
var oDlg = {
strName: "", initialize: function(dialog) {
dialog.load({"usnm":this.strName});
},
commit: function(dialog) {
var data = dialog.store();
this.strName = data[ "usnm"];
},
description: {
name: "Test Dialog", elements: [ {
type: "view", elements: [
{ name: "Enter your name:", type: "static_text", },
{ item_id: "usnm", type: "edit_text", char_width: 15 },
{ type: "ok_cancel", },
]
} ]
}
};
// Dialog Activation
var cMsg = "Sample init value";
oDlg.strName = cMsg;
if( "ok" == app.execDialog(oDlg))
{
cMsg = oDlg.strName;
}
event.value = cMsg;
event.source.source.info.exhibit = cMsg;
}
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.