Add a watermark with fields with JavaScript / c#
I want to add a watermark with JS method addWatermarkFromFile. The watermak is a PDF file that has fields where I can enter some information (user name, date, time, for example) and save it in the file watermak. If I use the Add Watermak in Acrobat X window, the contents of the fields appears in the watermark on the files. However, if I use JS this.addWatermarkFromFile (...) (that this either with all the parameters of seizures, or simply use a para the full path of the file watermark), watermak can be added, but the fields are completely absent. What I miss in JS? Thank you.
PS please don't tell me to use the dynamic buffer. All this will be done in c# finnally. Custom dynamic stamp does not work with c# as I expected.
Yes, addWatermarkfromFile will not focus on the fields.
That's why I recommend making TWO DISTINCT operations.
(1) stamp in the main parts of PDF
(2) the fields (i.e. create new text watermark, etc.)
From: santa-satan [email protected]<>[email protected]>
Reply-To: "[email protected]<>[email protected]> ' [email protected]<>[email protected]>" "
Date: Wednesday, February 8, 2012 06:26:18-0800
To: Leonard Rosenthol [email protected]<>[email protected]>
Subject: Add a watermark with fields with JavaScript / c#
Add a watermark with fields with JavaScript / c#
created by santa-satanhttp://forums.adobe.com/people/santa-satan> in Acrobat SDK - see the discussion complete onhttp://forums.adobe.com/message/4193350#4193350
Tags: Acrobat
Similar Questions
-
How to add a button with Javascript library
Hello
I am using Captivate 5.5 to create a template.
In the files that will be created by using this template, we will add a button that executes a Javascript script. Now my question is, given that this button will be used across multiple slides in the file, I can add this button (with the Javascript code) to the library? We currently create manually everytime.
We do not have a programmer on our team, so that we cannot create the widget. Is there another way?
Thanks for your help.
Anthony
Why do you need to remove the slide?
I have a white blank slide at the beginning of all my modules of Captivate. There are some issues that appear to be avoided if the first slide has nothing about it. You don't have to do this very long slide. Usually mine are just a second, in the long term.
-
Add new category with javascript
Hello world
Can a new category be added using javascript?
At soon Daniel
No, only by the admin, product import, import catalog and by API.
-
Need help with Add/Remove buttons work field
Someone here on the forums had previously helped me to get a button set up a form that would add an additional text field to a form. I need now to a separate created button that will remove a text field in the case where too many have been added. I hope someone can help me with this because my XML knowledge is virtually nil. It's not like I can upload files to the forum here, so I'll try to paste my code. I just need to get the "-" button to subtract a line. Thanks in advance for the help.
-Chris
<? XML version = "1.0" encoding = "UTF-8"? >
<? XFA generator = APIVersion "AdobeLiveCycleDesignerES_V8.2.1.4029.1.523496" = "2.8.9029.0?" >
" < = xmlns:xdp xdp:xdp ' http://ns.Adobe.com/XDP/ " "timeStamp ="2010-06 - 28 T 16: 04:04Z" uuid = "081329f3-4914-4dde-87ae-75a83da8434e" >
" < model xmlns =" http://www.XFA.org/schema/XFA-template/2.6/ ">
<? formServer defaultPDFRenderFormat acrobat8.1static? >
< name of the subform = "form1" layout = "CT" local = "en_US" >
< Pagesand >
< name Pagearea = "Page1" id = "Page1" >
< contentArea x = 'No 19.05 mm' y = '12.7 mm"w ="190.5 mm"h ="266.7 mm"/ >
< average stock = "default" short = long "612pt" = "792pt" / >
<? templateDesigner expand 1? > < / pageArea >
<? templateDesigner expand 1? > < / Pagesand >
< subform w = "7.5" in h = "10.5" in name = "Page1" >
< subform w = y "174,625 mm" = "79,377 mm" name = "Current_Objectives" layout = "CT" >
< subform w = h "174,625 mm" = "9,522 mm' name = 'Objective' >
< = minH "txt_currobj" field name = '8,263 mm"w = mm"174,625">
< ui >
< textEdit multiLine = "1" >
< border >
<? templateDesigner styleId aped3? >
< STROKE edge = "lowered" / >
< / border >
< margin / >
< / textEdit >
< /UI >
< font size = cast '11pt' = "Verdana" / >
< topInset margin = ' 1 mm ' bottomInset = ' 1 mm ' leftInset = ' 1 mm ' rightInset = ' 1 mm "/ >
< para vAlign = "middle" / >
< caption reserve '7,76 mm' = >
< para vAlign = "middle" / >
< value >
< text > 1. < / text >
< / value >
< font size = cast '11pt' = "Verdana" / >
< / legend >
< activity = 'initialize' name = "event__initialize" >
< script contentType = "application/x-javascript" > this.caption.value.text.value = (this.parent.index + 1) + "."
< /script >
< / event >
< / field >
< occur max = "-1" / >
<? templateDesigner expand 1? > < / subform >
< field h = "5.08 mm" name = "curr_obj_add_line" w '5.08 mm' = >
< ui >
< button nail = 'push' / >
< /UI >
< character = "Arial" / >
< caption >
< value >
< text > + < / text >
< / value >
< para hAlign = "center" vAlign = "middle" / >
< character = "Arial" / >
< / legend >
< border = 'right' hand >
< STROKE edge = "raised" / >
< filling >
< color value = '212, 208, 200' / >
< / filling >
<? templateDesigner styleId apbx2? > < / border >
< link match = "none" / >
< help >
< toolTip > add < / ToolTip >
< / help >
< activity = "click on" name = "event__click" >
< script contentType = "application/x-javascript" >
_Objective.addInstance (1)
< /script >
< / event >
< / field >
< field h = "5.08 mm" name = "curr_obj_del_line" w '5.08 mm' = >
< ui >
< button nail = 'push' / >
< /UI >
< character = "Arial" / >
< caption >
< value >
< text > - < / text >
< / value >
< para hAlign = "center" vAlign = "middle" / >
< character = "Arial" / >
< / legend >
< border = 'right' hand >
< STROKE edge = "raised" / >
< filling >
< color value = "212,208,200" / >
< / filling >
<? templateDesigner styleId apbx2? > < / border >
< link match = "none" / >
< help >
< toolTip > delete an element < / ToolTip >
< / help >
< activity = "click on" name = "event__click" >
< script contentType = "application/x-javascript" >
_Objective.deleteInstance (1)
< /script >
< / event >
< / field >
<? templateDesigner expand 0? > < / subform >
<? templateDesigner expand 1? > < / subform >
< desc >
< name of text = 'version' > 8.2.1.4029.1.523496.503679 < / text >
< / desc >
<? templateDesigner expand 1? > < / subform >
<? templateDesigner DefaultLanguage FormCalc? >
<? templateDesigner client DefaultRunAt? >
<? Acrobat JavaScript strictScoping? >
<? templateDesigner Zoom 100? >
<? templateDesigner grid see the: 1, wink: 1, units: 0, color: ff8080, origin: (0,0), interval: (125000,125000)? >
<? templateDesigner 26 FormTargetVersion? >
<? templateDesigner 1 SaveTaggedPDF? >
<? templateDesigner 1 SavePDFWithEmbeddedFonts? >
<? templateDesigner horizontal management: 1, vertical: 1, guidelines: 1, crosshairs:0? > < / template >
" < config xmlns =" http://www.XFA.org/schema/XCI/2.6/ ">
< name of agent 'designer' = >
PDF of < destination > < / destination >
< pdf >
<!-[0 n]->
< fontInfo / >
< / pdf >
< / agent >
< date >
<!-[0 n]->
< pdf >
<!-[0 n]->
< version > 1.7 < / version >
< adobeExtensionLevel > 1 < / adobeExtensionLevel >
< / pdf >
< common / >
< script >
Server < runScripts > < / runScripts >
< /script >
< xdp >
packs of <>* < / packages >
< / xdp >
< / date >
<? originalXFAVersion http://www.XFA.org/schema/XCI/2.8/ ? > < / config >
" < Romagna xmlns =" http://www.XFA.org/schema/XFA-locale-set/2.6/ ">
<? originalXFAVersion http://www.XFA.org/schema/XFA-locale-set/2.6/ ?>
< name of locale = 'en_US' desc 'English (United States)' = >
< name calendarSymbols = "Gregorian" >
< monthNames >
< month > January < / month >
< month > February < / month >
< month > March < / month >
< month > April < / month >
< month > may < / month >
< month > June < / month >
< month > July < / month >
< month > August < / month >
< month > September < / month >
< month > October < / month >
< month > November < / month >
< month > December < / month >
< / monthNames >
< abbr monthNames = "1" >
< month > Jan < / month >
< month > Feb < / month >
< month > Tue < / month >
< month > after < / month >
< month > may < / month >
< month > Jun < / month >
< month > Jul < / month >
< month > August < / month >
< month > Ms < / month >
< month > Oct < / month >
< month > Nov < / month >
< month > Dec < / month >
< / monthNames >
< dayNames >
< day > Sunday < / day >
Monday < day > < / day >
< day > Tuesday < / day >
< day > Wednesday < / day >
< day > Thursday < / day >
< day > Friday < / day >
< day > Saturday < / day >
< / dayNames >
< dayNames abbr = "1" >
< day > Sun < / day >
< day > LUN < / day >
< day > Tue < / day >
< day > sea < / day >
< day > set < / day >
< day > sat < / day >
< day > Sat < / day >
< / dayNames >
< meridiemNames >
< meridiem > AM < / meridiem >
< meridiem > AM < / meridiem >
< / meridiemNames >
< eraNames >
< age > BC < / era >
< age > AD < / era >
< / eraNames >
< / calendarSymbols >
< datePatterns >
< name datePattern 'full' = > EEEE, MMMM D, YYYY < / datePattern >
< name datePattern = "long" > D MMMM, YYYY < / datePattern >
< name datePattern "med" = > MMM D, YYYY < / datePattern >
< name datePattern "short" = > d/m/YY < / datePattern >
< / datePatterns >
< timePatterns >
< name timePattern 'full' = > SS A Z < / timePattern >
< name timePattern = "long" > SS A Z < / timePattern >
< name timePattern "med" = > SS A < / timePattern >
< name timePattern 'short' = > h: mm A < / timePattern >
< / timePatterns >
< dateTimeSymbols > GyMdkHmsSEDFwWahKzZ < / dateTimeSymbols >
< numberPatterns >
< name numberPattern 'digital' = > z, zz9.zzz < / numberPattern >
< name numberPattern = "currency" > $z, zz9.99 | ($z, zz9.99) < / numberPattern >
< name numberPattern = '%' > z, zz9% < / numberPattern >
< / numberPatterns >
< numberSymbols >
< name numberSymbol 'decimal' = >. < / numberSymbol >
< numberSymbol = "group" name >, < / numberSymbol >
< name numberSymbol = '%' > % < / numberSymbol >
< numberSymbol name = 'less' > - < / numberSymbol >
< numberSymbol name = "zero" > 0 < / numberSymbol >
< / numberSymbols >
< currencySymbols >
< currencySymbol = 'symbol' name >$ < / currencySymbol >
< name currencySymbol = "isoname" > $ < / currencySymbol >
< currencySymbol = "decimal" name >. < / currencySymbol >
< / currencySymbols >
<>fonts
< name of font = 'Myriad Pro' / >
< name of font = "Minion Pro" / >
< name of font = "Courier Std" / >
< name of font = "Adobe Pi Std" / >
< name of font = "Adobe Hebrew" / >
< name of font = 'Adobe Arabic' / >
< name of font = 'Adobe Thai' / >
< name of font = "Kozuka Gothic Pro - VI M" / >
< name of font = "Kozuka Mincho Pro - VI R" / >
< name of font = 'Adobe Ming Std L' / >
< name of font = "Adobe song Std L" / >
< name of font = "Adobe Myungjo Std M" / >
< / font >
< / locale >
< / Romagna >
< xmlns: x x: xmpmeta = "adobe: ns:meta / ' x: xmptk =" Adobe XMP Core 4.2.1 - c041 52.337767, 2008/04/13-15: 41:00 ">" "" "
" < RDF: RDF = xmlns:rdf ' http://www.w3.org/1999/02/22-rdf-syntax-ns# ">
" < Xmlns:xmp = RDF" http://ns.Adobe.com/Xap/1.0/ "rdf: about =" "> "
< xmp:MetadataDate > 2010-06-28 T 16: 04:04Z < / xmp:MetadataDate >
< xmp:CreatorTool > Adobe LiveCycle Designer ES 8.2 < / xmp:CreatorTool >
< xmp:ModifyDate > 2010-06-28 T 11: 28:54 - 04:00 < / xmp:ModifyDate >
< xmp: CreateDate > 2010-06-18T 11: 45:23 - 04:00 < / xmp: CreateDate >
< / RDF: Description >
" < Xmlns:pdf = RDF" http://ns.Adobe.com/PDF/1.3/ "rdf: about =" "> "
< pdf:Producer > Adobe LiveCycle Designer ES 8.2 < / pdf:Producer >
< / RDF: Description >
" < Xmlns:xmpMM = RDF" http://ns.Adobe.com/Xap/1.0/mm/ "rdf: about =" "> "
< xmpMM:DocumentID > uuid:081329f3-4914-4dde-87ae-75a83da8434e < / xmpMM:DocumentID >
< xmpMM:InstanceID > uuid:4d9ea5d0-fbf1-4be5-8aa5-b9c828a765e9 < / xmpMM:InstanceID >
< / RDF: Description >
" < Xmlns = RDF" http://purl.org/DC/elements/1.1/ "rdf: about =" "> "
< dc:format > application/pdf < / dc:format >
< / RDF: Description >
" < Xmlns:desc = RDF" http://ns.Adobe.com/XFA/promoted-desc/ "rdf: about =" "> "
< desc:version rdf:parseType = "Resource" >
< rdf: value > 8.2.1.4029.1.523496.503679 < / rdf: value >
< desc:ref >/template/subform [1] < / desc:ref >
< / desc:version >
< / RDF: Description >
< / RDF: RDF >
< / x: xmpmeta >
" < xfdf xmlns =" http://ns.Adobe.com/XFDF/ "XML: Space ="preserve"> "
< annots / >
< / xfdf > < / xdp:xdp >
Hello
It is difficult to see the XML Source what is happening. There are sites like YouSendIt.com or Acrobat.com where you can download files from file sharing.
In any case, I see the Add button, then the delete row button would look like:
_Objective.removeInstance(this.parent.index);
The underscore character is a shortcut for instanceManager. I suspect that the goal is the repetitive element. It is easier to include the button Delete a row in the repeating line, in this way the user can select which line they want to delete.
There is an example here: https://acrobat.com/#d=tdpzltrl25yU2PkvgaQO9w
Look in the click event of the button 'X '.
Good luck
Niall
-
Text form field properties: access with Javascript?
Hello
I wonder if it is possible to access all of the properties of text form field with Javascript.
The basic game is available under the domain object, but I'm looking for the other stuff that does not specifically exist for the fields of rich text, such as the properties of next paragraph:
Dashes (left and right, withdrawal, first to the first line indent), the vertical alignment (top, bottom, middle), space above and below and attack (line spacing).
All this is available if you place your cursor in a rich text field and press Ctrl-E to open text form field properties, then click on "More".
So I wonder if it is also accessible via JS, because I can't find anything in the documentation on the subject.
Thanks much for any help!
Ariel
Some properties of rich text are available, but not those you mentioned.
I'm afraid.
Study of the Span object to find out which ones are.
-
How to paste into the text field of the Clipboard with JavaScript?
I implement the following actions in the form of javascript:
1. a user clicks on a link on the PDF to open a web page
2. the user uses the web page to find information and then copy text from the web page
3. the user clicks a button on the pdf form and it formats the text to the Clipboard and paste them into the text fields.
I can't find any references for the reading of the data from the Clipboard with javascript in PDF Forms. is it not possible?
Perhaps 'not possible' was a little too hard. It would be a security hole if she accepts a script in a form to copy the contents of the Clipboard without the user explicitly allowing it. It has been possible to copy the contents of the Clipboard into a form field using the app.execMenuItem method without the user knowing / allowing it, but that hole was closed. The restriction can be overcome, as explained in the documentation: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.143.html
-
I created a Javascript script that adds a watermark on the document action "paper print". This works in Acrobat Pro, but does not work in the drive. I am a novice using Javascript, so what am I doing wrong?
Cannot use either addWatermarkFromFile or addWatermarkFromText methods of document with player as shown in the documentation. You can hide/display the form fields and the existing layers, so consider this approach.
-
Get item URLS with Javascript Page
I want to make a link to a page, passing in a variable (P99_SOMETHING) in the URL:
f? p = xx:xx:xx:NO:P99_SOMETHING:TEST
On the page (P99), I want to be able to access P99_SOMETHING with Javascript.
I tried to add a page hidden page called P99_SOMETHING, but what is hidden is not filled with the TEST. Also when I try to access JavaScript with:
Alert (' val: "+ $v ("P99_SOMETHING")");
The alert says, but he has an empty value.
Parameters of the Page element:
Name = P99_SOMETHING
Serves as a source = always, by replacing the value that exists in session state
Type = Item (the item application or page name)
Expression = P99_SOMETHING
What am I missing or doing wrong?
Using Apex 4.2
Published by: 973239 on November 26, 2012 07:06
Published by: 973239 on November 26, 2012 07:07Hello
If I understand correctly, you set the value of P99_SOMETHING in another page in your application. In this case, the setting of page # 99 article can be modified to:
Source used (s) = only when the current value in session state is zero
Type = static assignment (the value corresponds to the attribute of the source)No need to put anything in the field of Expression.
Can you check in 'Session' (in the developer toolbar) to ensure that the value of the element is used?
And in your alert, try $v ('P99_SOMETHING') - apostrophes to see if there is a difference.Thank you
RohitPublished by: jaouad khalifi on November 26, 2012 07:42
-
I have a form in which the user enters several lines of data as well as additional information on these data. I would like finally to export data, so I can manipulate the Excel. This is possible because javascript (or otherwise)? Here is an example of what I mean.
The form of a table in which the user enters each of the names of his friend, their favorite color and their age. I want the name of the specific friend linked to their favorite color and age so when I export to excel I can see how many friends has the user whose favorite color is red.
If the form data would be as follows:
Friend1name
Friend2name
Friend3name
Friend1color
Friend2color
Friend3color
Friend1age
Friend2age
Friend3age
When I export the data as entered above, the results of each field in another column.
Anyone has any ideas for that?
It is possible with JavaScript. You can write the data to the JavaScript console and then copy & paste into Excel, or write to a file as an attachment (aka data object) and export it. Here's a sample script that writes the field data in the JavaScript console:
Table of domain names
Invoke the var = ['Friend1name', 'Friend2name', 'Friend3name', 'Friend1color', 'Friend2color', 'Friend3color', 'Friend1age', 'Friend2age', 'Friend3age'];
Browse the fields and write the field values in the console
for (var i = 0; i)< afields.length;="" i="" +="1)">
Console.println (getField(aFields[i]).valueAsString);
}
Display console
Console.Show ();
You can place this code in the mouse event to the top of a button and click the button to run it. This last line of code displays the console and you will be able to copy & paste the data.
-
Add a PowerShell with Kerberos host
Hi, I just added my domain controller name powershell host and it works not much, but now I need to add another host and this isn't a field control, but I need to run on a command powershell with domain administrator privileges, so I need to add this host powershell with kerberos authentication, how can I do this?
I have installed a new virtual machine and add the host with kerberos without problem...
the problem was the net framework 4.5
-
Open and close the Popup with Javascript
Using Apex 3.2
I probably have done this lots of times in my old job, but do not have access to the code and now I can't work properly.
I opened a window pop up with javascript
Now, I need to close and refresh the calling page, but only if it ratifies the validation on the popup.
I have an item hidden on my pop up called P7_FLAG.
I have a process page after validation that affects P7_FLAG (only the value 1, if passes validation).
I also have a "SUBMIT" button.
So once I click my button "SUBMIT" page should look at validations, so ok, P7_FLAG the value 1, then close the popup and refresh the calling page.
My current look of javascript like this
My button<script type="text/javascript"> function saveChanges(){ doSubmit('SUBMIT'); var test = $x('P7_FLAG').value; if(test == '1') { window.close(); window.opener.doSubmit('REFRESH'); } } </script>
The problem is that I need to click twice on the button SUBMIT.javascript:saveChanges();
First, it sets P7_FLAG
Second time, it closes page and refreshes.
I probably made a fundamental mistake, but today I can't.
See you soon
Gus
Published by: Gus C 10 may 2012 12:48Sorry about that I was blind
Add this function to your page
Call this function on the loading of the page
onload="onloadclose();"
-
is it possible to get variable windows environment such as % username % with javascript using Adobe pro 10?
Code:
myTrustedUserName();
call the function one returns "identity.loginName". You can assign it to a variable:
var Lname = myTrustedUserName();
or set a field value
this.getFieldName("Lname_Field").value = myTrustedUserName();
or put in an app.alert:
App.Alert ("username:" + myTrustedUserName());
or view it in the console
Console.Show ();
Console.clear();
Console.println (myTrustedUserName());
If you use the table replace "myTrustedUserName()" with "Idefence [loginName]."
You may need to modify the examples for the name of the field as needed
-
Publication and display locally a captivate with javascript project custom
Hi all
Ive had a problem that I can not work.
I started working with javascript, so when I want to listen to excerpts of the document, I use F12, which works correctly.
Also, when I use captivate to publish my projects directly on my site it works fine also.
However when I publish locally, when I go to view the output, javascript does not seem to load.
Pretty funny. The same file when downloaded on my site and then seen it works fine.
What is the cause? And I can do to fix this?
Concerning
Mathew
Mathew, you must add the location of publication record as a trusted location in your Flash Global security settings.
Google for info on Flash Global Security.
-
"import as layer" with javascript?
Hello!
I was wondering if there is one here who could give me some batch processing javascript in Acrobat tips. My problem is the following... I have many (thousands) of pdf that have an object on a layer with incorrect data. In Illustrator, I wrote a script which allows to reconstruct this object fills with correct data from a csv file and then saves in a pdf file with a name that matches the master pdf, in that it must be inserted.
What I want to do with a batchscript of javascript is for each open file is to find the file name and the newly created pdf file is found (done) then do something equivalent to the command "import as layer" and import to an existing layer already in the main PDF so the new masks the old object. This I can't do... Well, really, I can't do a lot with js in acrobat for that matter. I can't even a var to return a value to the colsole for testing. It returns no "defined."
I can find the layer I need to manipulate with ' this .getOCGs () [0] ", the layer I need to handle reaches zero and using the"Merge layers"example in the Guide scripts JavaScript Acrobat a layers properties are modified to match the target layer but it always appears as a distinct physical layer.
What I just wrote is unable to make sense of bones of bunch so in other words... What I want to do with javascript, it is the action of the "Import under the layer" option selected in the layers panel in mirror. The function key I want to make is in the 'Options of Import' is to 'add to the existing layer.
I appreciate any help that can be offered.
JT
There is much that can be done with JavaScript in Acrobat.
As far as I know, you can add or merge a layer directly, but you can add a BCG with the addWatermarkFromFile() method.About the console, simply run your code and either select the name of the variable you want to examine or type it, and then press Ctrl + Enter. It displays its value. For example, if you run this code:
var a = 2 + 5;
one;The result will be "7".
-
Adding a watermark with the batch.
Is it possible to add a watermark, resize an image, add the jpg compression all at once through batch in Fireworks?
Thank you!
Yes.
Maybe you are looking for
-
ITunes can add images to mp3 created from vinyl record?
I created on a 1000 mp3 files (320 bps, 441hz) of the vinyl record. Obviously, I can manually create images of these files individually but will take a while, so I was wondering if iTunes can automatically create. I tried to select all the images i
-
I bought at the flea market, so obviously did not expect, but when I went on the site, looking for a way to get a CD, nothing came. Anyone know how I could do to get one?
-
Win 2003 Server installation problem
Hello everyoneI am trying to install Windows server 2003 32-bit downloaded from Microsoft VLSC of my Microsoft account. I downloaded all available versions and I'm trying to start a server x 3250 M3 of IBM, but without success. The same problem occur
-
Screenshots using home ++-how to operate?
TITILE says it all. I removed the app BUTTON SHORTCUT (installed to VDHF) and restarted the Droid. Yet, no joy. HOME ++ said I should be able to type the button of the camera and release and that it will take a screenshot and immediately save the ima
-
What is the average number of pages printed using cartridge 564XL in HP Photosmart 7510 e-all-in-one
This printer seems to use a lot more than my previous HP Photosmart C7200 ink I installed 3 cartridges besides that which is provided, the last being 564XL black and I have printed only 1288 pages and scanned 197. When he missed with the 564XL ink he