Copy link to clipboard
Copied
How I Could replace the font for the document in the console of Javascript with commands line? I would like to edit the document and modifing the font that it is Arial for example to other font that it is Calibri. And save the document. But I would like to do this in the command line and over all the document.
Copy link to clipboard
Copied
Not possible with Javascript.
Copy link to clipboard
Copied
Want you change the font of the Javascript console or what?
Copy link to clipboard
Copied
I would like to change the font of the document pdf but not in the edit section, I want to change the font with the console. For example you could change the font that is used when laying out text in a text field or button. But I don't know how I change in a text plain of the pdf and what if the container that contain the text plain of the doc.
Copy link to clipboard
Copied
Here's a script you can use to set the font of all text fields in the document to something:
var i, f;
for (i = 0; i < numFields; i += 1) {
f = getField(getNthFieldName(i));
if (f && f.type === "text") {
f.textFont = "calibri"; // Use font name for Calibri here
}
}
Note that "calibri" in the code above probably isn't correct. so you have to determine the correct name yourself. To do so, you can run the following line of code in the console:
getField("Text1").textFont;
where "Text1" is the field name of field that you'e set the font to Calibri. When executed, it will return the font name that you can use to set the font of fields to Calibri.
Copy link to clipboard
Copied
It looks like the correct name is "Calibri", so you can try that.
Copy link to clipboard
Copied
Yes, this is correct and change the font for the fields of a form. But I would like to change the text plain.
Copy link to clipboard
Copied
Not possible with Javascript.
Copy link to clipboard
Copied
With C or Java is possible? Thanks.

