Recent Posts

Pages: 1 ... 5 6 [7] 8 9 10
61
General / Re: Metadata Popup Box???
« Last post by RTT on August 08, 2017, 02:15:32 AM »
Uncheck the "enable the metadata capture assistant" named menu item in the preview handler tools main menu.
62
General / Metadata Popup Box???
« Last post by Rick on August 08, 2017, 12:46:00 AM »
How do you turn off / disable metadata box....I'm trying to rename files, via copy/paste...and the box keeps popping up...

Thanks...please let me know...
63
Ideas/Suggestions / Re: UPDATE to Rotate Pages Command
« Last post by RTT on August 07, 2017, 04:05:16 PM »
question though... can we get it to save over the original file or save it to another location with the same filename?
The relevant line is:
if (Pages.CommitChanges(pdfe.SelectedFiles(i).Filename + '(rot).pdf')) {

To save over, replace it by:
if (Pages.CommitChanges() {

To save to another location, replace it by:
var Filename=pdfe.SelectedFiles(i).Filename;
if (Pages.CommitChanges('c:\\your\\other\path\\'+Filename.substr(Filename.lastIndexOf('\\') + 1)) {
64
Ideas/Suggestions / Re: UPDATE to Rotate Pages Command
« Last post by nightslayer23 on August 04, 2017, 05:58:15 AM »
question though... can we get it to save over the original file or save it to another location with the same filename?
65
Ideas/Suggestions / Re: UPDATE to Rotate Pages Command
« Last post by nightslayer23 on August 04, 2017, 05:04:30 AM »
awesome! thank you
66
Ideas/Suggestions / Re: UPDATE to Rotate Pages Command
« Last post by RTT on August 04, 2017, 01:28:48 AM »
In the next version, 3.2, it will be possible to use the words "landscape" and "portrait" as page selectors, in any of the tools that have the possibility to define the list of affected pages. I have it already implemented, as depicted in the attached screenshot.

Even so, you can do it already with a script.
Here's one that rotates all the portrait pages by 90 degrees:
Code: [Select]
var ProgressBar = pdfe.ProgressBar;
ProgressBar.max = pdfe.SelectedFiles.Count;

for (var i = 0; i < pdfe.SelectedFiles.Count; i++) {
    ProgressBar.position = i + 1;
    try {
        var Pages = pdfe.SelectedFiles(i).Pages;
        var RotatedPagesCount = 0;
        for (var PageIndex = 0; PageIndex < Pages.Count; PageIndex++) {
            var Page = Pages(PageIndex);
            if (Page) {
                //Note: this rotation angle check should be removed for versions>3.1.x           
                if (Page.Rotation == 90 || Page.Rotation == 270) {
                    var w = Page.Height;
                    var h = Page.Width;
                } else {
                    var w = Page.Width;
                    var h = Page.Height;
                }

                if (h > w) {
                    Page.Rotation = Page.Rotation + 90;
                    RotatedPagesCount++;
                }
            }
        }
        if (RotatedPagesCount) {
            if (Pages.CommitChanges(pdfe.SelectedFiles(i).Filename + '(rot).pdf')) {
                pdfe.echo(pdfe.SelectedFiles(i).Filename + ' (rotated ' + RotatedPagesCount + ' pages)');
            } else {
                pdfe.echo(pdfe.SelectedFiles(i).Filename + ' (failed to commit changes)', 0xFF0000);
            }
        } else {
            pdfe.echo(pdfe.SelectedFiles(i).Filename + ' (nothing to rotate)');
        }
    } catch (e) {
        pdfe.echo(pdfe.SelectedFiles(i).Filename + ' :' + e.message, 0xFF0000);
    }
}
pdfe.echo("Done");
67
Ideas/Suggestions / Re: Split multi-page & multi-page.size PDF into respective sizes
« Last post by RTT on August 04, 2017, 01:05:15 AM »
This should do the job ;)
Code: [Select]
var Merger = pdfe.CreateDocumentMerger();
var ProgressBar = pdfe.ProgressBar;
ProgressBar.max = pdfe.SelectedFiles.Count;

for (var i = 0; i < pdfe.SelectedFiles.Count; i++) {
    ProgressBar.position = i + 1;
    try {
        var PreviousPSizeStr = '',
            SplitGroupIndex = 1,
            StartIndex = 1;
        var File = pdfe.SelectedFiles(i),
            Filename = File.Filename,
            Pages = File.Pages;
        var Path = Filename.substr(0, Filename.lastIndexOf('\\') + 1),
            Name = Filename.substring(Path.length, Filename.lastIndexOf('.'));

        for (var PageIndex = 0; PageIndex < Pages.Count; PageIndex++) {
            var Page = Pages(PageIndex);
            if (Page) {
                //Note: this rotation angle check should be removed for versions>3.1.x
                if (Page.Rotation == 90 || Page.Rotation == 270) {
                    var w = Page.Height;
                    var h = Page.Width;
                } else {
                    var w = Page.Width;
                    var h = Page.Height;
                }

                var PSizeStr = w.toFixed() + 'x' + h.toFixed();
                if (PageIndex == 0) {
                    PreviousPSizeStr = PSizeStr
                } else if (PreviousPSizeStr != PSizeStr) {
                    Split(Filename, Path + pad(SplitGroupIndex, 2) + ' (' + Name + ').pdf', StartIndex, PageIndex);

                    PreviousPSizeStr = PSizeStr;
                    StartIndex = PageIndex + 1;
                    SplitGroupIndex++;
                }
            }
        }
        if (StartIndex <= Pages.Count) //split remaining
        Split(Filename, Path + pad(SplitGroupIndex, 2) + ' (' + Name + ').pdf', StartIndex, Pages.Count);
    } catch (e) {
        pdfe.echo(Filename + ' :' + e.message, 0xFF0000);
    }
}

pdfe.echo("Done");

function Split(Filename, NewFilename, StartPage, EndPage) {
    if (Merger.MergeDocument(Filename, StartPage + '-' + EndPage) && Merger.EndAndSaveTo(NewFilename)) {
        pdfe.echo(NewFilename + ' [OK]', 0)
    } else {
        pdfe.echo(NewFilename + ' [Failed]', 0xFF0000);
    }
}

function pad(n, width, z) {
    z = z || '0';
    n = n + '';
    return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}
68
Ideas/Suggestions / UPDATE to Rotate Pages Command
« Last post by nightslayer23 on August 03, 2017, 03:14:45 AM »
Can we get an update for the Rotate Pages Batch Command to incorporate the parameter of Landscape or Portrait pages?

At the moment it can only rotate by page numbers, if it could rotate "portrait pages only" or something it'd be awesome!
69
Hey bud,

So I have a need for splitting Mulitpage pdfs that have multiple page sizes right, but I need to split PDF results to be in respect to page sizes.

So, eg: 300page PDF. A4 & A3.

Pages 1-100 are A4
Pages 101-149 are A3
Pages 150-300 are A4

Desired Result:
Filenames:
01 (original filename).pdf - containing pages 1-100
02 (original filename).pdf - containing the next size being A3 101-149
03 (original filename).pdf - containing the remaining pages of A4

Could this be a script you could help me with? It would be some sort of edit to the original split pdf function? I am just not up with how to code is all :S
70
Ideas/Suggestions / Re: Where to download / receive purchase product...from Avangate?
« Last post by RTT on July 25, 2017, 07:37:29 AM »
I've sent your license registration email just now. Let me know if the problem persist.
Pages: 1 ... 5 6 [7] 8 9 10