Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Ideas/Suggestions / Re: Comments Flattener
« Last post by nightslayer23 on September 19, 2019, 12:52:24 AM »
excellent! thankyou
22
Ideas/Suggestions / Re: Comments Flattener
« Last post by RTT on September 17, 2019, 01:06:22 AM »
what do I need to take out of this script so it is a save over original file ?
This should do it.
Code: [Select]
var app = pdfe.CreateObject("AcroExch.App");
var baseDoc = pdfe.CreateObject("AcroExch.PDDoc");

var ProgressBar = pdfe.ProgressBar;
ProgressBar.max = pdfe.SelectedFiles.Count;

for (var i = 0; i < pdfe.SelectedFiles.Count; i++) {
    try {
        ProgressBar.position = i + 1;
        var FileObj = pdfe.SelectedFiles(i);
        var FullPathFilename = FileObj.Filename;
        FileObj.Close();

        pdfe.echo('Flattening: ' + FullPathFilename);

        baseDoc.Open(FullPathFilename);

        try {
            var JSObject = baseDoc.getJSObject();
            JSObject.addScript("flatten", "function flatten(){this.flattenPages();}flatten();");
            JSObject.removeScript("flatten");
            baseDoc.Save(1, FullPathFilename);
            pdfe.echo(" [OK]", 0, 1);
        } catch (err) {
            pdfe.echo(err, 0xFF0000);
            pdfe.echo("");
        }
        baseDoc.Close();
    } catch (err) {
        pdfe.echo(err, 0xFF0000);
        pdfe.echo("");
    }
}
app.Exit();
pdfe.echo('\nDone');
23
Ideas/Suggestions / Re: Comments Flattener
« Last post by nightslayer23 on September 16, 2019, 12:35:05 AM »
yes I worked out how to use it just after I posted.

please see my last post for other enquiry
24
Ideas/Suggestions / Re: Comments Flattener
« Last post by RTT on September 16, 2019, 12:17:15 AM »
so this script is to be installed into acrobat correct?
No. This is a PDF-ShellTools script, to run from the PDF-ShellTools scripts interface, so could be added to the PDF-ShellTools context menu. It just needs Acrobat Professional to be installed, as it uses it to do the work.
25
Ideas/Suggestions / Re: Comments Flattener
« Last post by nightslayer23 on September 16, 2019, 12:06:11 AM »
so this script is to be installed into acrobat correct?

this isn't a script we could add to the PDF Shell Tools context menu?


never-mind! I see it works from the context menu! fantastic..

what do I need to take out of this script so it is a save over original file ? I'd like to add the script to a super script that I have that checks size & orientation but flattens comments at the same time (which I've already put together). same with a version that checks size, orientation & coverage, would need it to flatten prior to checking for coverage.
26
Ideas/Suggestions / Re: Comments Flattener
« Last post by RTT on September 14, 2019, 01:06:44 AM »
No internal code to do this, but here is a script to automate Acrobat Professional to do it.
Code: [Select]
var objShell = new ActiveXObject("shell.application");
var objFolder;
objFolder = objShell.BrowseForFolder(0, "Select the destination folder", 0x10, 0x11);

if (objFolder != null) {
    var DestFolder = objFolder.self.path;
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    var app = pdfe.CreateObject("AcroExch.App");
    var baseDoc = pdfe.CreateObject("AcroExch.PDDoc");
    var ProgressBar = pdfe.ProgressBar;
    ProgressBar.max = pdfe.SelectedFiles.Count;

    for (var i = 0; i < pdfe.SelectedFiles.Count; i++) {
        try {
            FullPathFilename = pdfe.SelectedFiles(i).Filename;
            var Filename = FullPathFilename.substr(FullPathFilename.lastIndexOf('\\') + 1);
            var DestFullPathFilename = fso.BuildPath(DestFolder, Filename);

            if (FullPathFilename == DestFullPathFilename) {
                DestFullPathFilename = FullPathFilename.substr(0, FullPathFilename.lastIndexOf('.') - 1) + '_flattened.pdf';
            }

            pdfe.echo('Flattening: ' + FullPathFilename);
            ProgressBar.position = i + 1;

            baseDoc.Open(FullPathFilename);

            try {
                var JSObject = baseDoc.getJSObject();
                JSObject.addScript("flatten", "function flatten(){this.flattenPages();}flatten();");
                JSObject.removeScript("flatten");
                baseDoc.Save(1, DestFullPathFilename);
                pdfe.echo(" [OK]", 0, 1);
            } catch (err) {
                pdfe.echo(err, 0xFF0000);
                pdfe.echo("");
            }
            baseDoc.close();
        } catch (err) {
            pdfe.echo(err, 0xFF0000);
            pdfe.echo("");
        }
    }
    app.Exit();
    pdfe.echo('\nDone');
}
27
Ideas/Suggestions / Comments Flattener
« Last post by nightslayer23 on September 13, 2019, 09:18:40 AM »
Could you translate a custom script for flattening all annotations, highlights and comments?

We've found these often drop off at the print level.

We have a current java script that does it perfect, but you have to do it file - by - file.

Be great if there was a way to do this as a batch.

the program that the script belongs in is: https://www.uvsar.com/projects/acrobat/flattener/
28
Ideas/Suggestions / Re: Create Bookmarks from Text String
« Last post by RTT on August 24, 2019, 01:55:33 AM »
The only uncertainly is the difficulty, or not, to find the text strings that defines each bookmark title and page target, as you haven't provided a sample file.
Thinking out of the box, because the merger tool is able to create bookmarks with the name of each merged file, the document can be searched for these text patters, split it at these page intervals (between two search matches) to a new file, named with the text found, and then merge this files into a new PDF.
29
Ideas/Suggestions / Re: Create Bookmarks from Text String
« Last post by nightslayer23 on August 23, 2019, 05:22:32 AM »
something you think may be possible..?
30
Ideas/Suggestions / Re: UPDATE to Rotate Pages Command
« Last post by nightslayer23 on August 23, 2019, 05:21:41 AM »
Bug found and fixed. It happens whenever the rotate pages select expression doesn't triggers any page needing rotation. With your sample file all the pages have landscape orientation, so no pages to rotate if the pages expression is "portrait". Fixed code will be in the next public release.
Thanks for reporting the issue.

no worries  ;D
Pages: 1 2 [3] 4 5 ... 10