Copy link to clipboard
Copied
I've written a basic script that does some adjustments to a PDF generated via HTML, such as renaming and formatting fields, setting the doc title, etc., and am looking to extend it to remove the generated footer text on each page, but cannot figure out how to achieve this.
Every page's footer is generated similar to 'file:///C/PDFs/Html%20Templates/new_form.html[9/27/2024 10:38:40 AM]'. I can edit and remove this manually, but I'd like for the script to achieve the same. Is it possible to access and remove these text fields through the script, or am I out of luck?
function trimFields(formTitle = "", verbose = false) {
console.println("Starting trimFields...");
if (formTitle) {
this.title = formTitle;
console.println("Form title set to " + this.title);
}
// Copy originals so as to not iterate the array while changing it
var originalFields = [];
for (var i = 0; i < this.numFields; i++) {
originalFields.push(this.getNthFieldName(i));
}
// .. omitted for brevity
}
Copy link to clipboard
Copied
You can avoid the text when you change the conversion settings.
Copy link to clipboard
Copied
I hadn't realized there was a different between supplying an HTML file for the "Single File" and doing it through "Web Page", very appreciated.
However, assuming whoever generated the PDF still has the leftover footer text, is it possible to extend to script to handle removal?
Copy link to clipboard
Copied
You can add Redaction annotations (using addAnnot) over these texts and then apply them (using applyRedactions), to remove them from the file.