Recent Posts

Pages: 1 ... 8 9 [10]
91
Bug reports / Merge in Silent mode is not quite silent
« Last post by conrad.drake on June 08, 2017, 05:33:20 AM »
Hi

Running the following command results in a popup saying "Loading files" (see attachment) which lists each of the files being merged (in this case 2,087 + 1 files totalling 4180 pages)

PDFShellTools merge -s -IncludeBookmarks -BookmarkAll -GroupBookmarks "filename=.\B2.2 Completed RFIs.pdf" "B2.2 Completed RFIs\Cover.pdf;B2.2 Completed RFIs\B2.2*.pdf"

The popup appears to occur with smaller merges but is almost invisible.

The most annoying aspect is that it takes "focus" away from whatever I'm doing.  Which breaks things like "shift-selecting" multiple items.

Sorry I have no further info on what's going on here.
92
General / Custom fields missing after windows update
« Last post by ekopta on June 08, 2017, 05:12:50 AM »
I just updated to the new Windows 10 Home build (version 1703, OS build 15063.332, 64-bit), and my custom fields have gone missing. They still appear in the PDF-ShellTools settings windows, themselves, but they are not displayed in the windows display pane, tooltips, mapping dropdown, or index viewer. I've tried reindexing the pdfs and rebuilding the index (and rebooting, for good measure), but I can't get them to display again. The data is still in the files themselves. How can I get them back?
93
General / Re: Refering to the last page
« Last post by conrad.drake on June 08, 2017, 04:54:29 AM »
Thanks - there's a bunch of options there.
94
General / Re: Displaying PDF Page Size in Windows Explorer
« Last post by RTT on May 31, 2017, 12:55:53 AM »
Would I make this a new script? And a new Metadata field?
This is just a code snippet, not a complete script, for you to use in the script you told was not working correctly when the pages where rotated.
A new script, or metadata field, depends if you also need the info from the original script. If not, you may just adapt the original script to your needs and store the info in the same field.
But the first script only gets the size of the first page, so if you need to know all the different sizes of the document, the code needs to be changed.
The newest script, that returns the list of sizes using the names for the standard paper sizes, is not useful for this as and A4 sheet is still A4 size even if landscape.
95
General / Re: Displaying PDF Page Size in Windows Explorer
« Last post by nightslayer23 on May 30, 2017, 04:13:25 AM »
Sometimes it works, sometimes not. Must be some glitch where if a pdf has been rotated to landscape, it takes on the original length and width and not the update rotation. I wanted to be able to differentiate Landscape and Portrait files from one another but it doesn't seem possible for some reason.
Indeed, the page width/height properties are not taking into account the page rotation! I will have this fixed in the next release.
Meanwhile, you can also check the page rotation:

        if (Page.Rotation == 90 || Page.Rotation == 270) {
            var w = Page.Height;
            var h = Page.Width;
        } else {
            var w = Page.Width;
            var h = Page.Height;
        }


Would I make this a new script? And a new Metadata field?
96
General / Re: Displaying PDF Page Size in Windows Explorer
« Last post by RTT on May 30, 2017, 02:27:16 AM »
Little mistake in these new code lines (I didn't tested it previously). I've edited my post with the correct code now.
97
General / Re: Displaying PDF Page Size in Windows Explorer
« Last post by nightslayer23 on May 30, 2017, 01:44:54 AM »
I get the following error:

Object doesn't support this property or method 144 8
98
General / Re: Displaying PDF Page Size in Windows Explorer
« Last post by RTT on May 29, 2017, 11:52:33 PM »
At what point do I modify this sorry to add the information to the metadata? I am trying but struggling  :S

You may replace the line
  pdfe.echo(' Sizes list: ' + sizesStr.substr(0,sizesStr.length-1));
by:
Code: [Select]
    sizesStr = sizesStr.substr(0, sizesStr.length - 1);
    var FileMetadata = pdfe.SelectedFiles(i).Metadata;
    if (FileMetadata.PageSize !== sizesStr) {
        FileMetadata.PageSize = sizesStr;
        if (FileMetadata.CommitChanges()) {
            pdfe.echo('(' + sizesStr + ') [OK]');
        } else {
            pdfe.echo('Set metadata property failed', 0xFF0000);
        }
    } else {
        pdfe.echo('(' + sizesStr + ') [already set]');
    }

99
General / Re: Displaying PDF Page Size in Windows Explorer
« Last post by nightslayer23 on May 29, 2017, 03:42:27 AM »
Quote
And show this info in a Windows Explorer column? How to format such data?
Commas?
A1,A4,A3 etc.
A quick modification of the included "List paper sizes used" sample script for you to play.
Code: [Select]
STDSizes=[
{'Size': 'A0','width':841,'height':1189},
{'Size': 'A1','width':594,'height':841},
{'Size': 'A2','width':420,'height':594},
{'Size': 'A3','width':297,'height':420},
{'Size': 'A4','width':210,'height':297},
{'Size': 'A5','width':148,'height':210},
{'Size': 'A6','width':105,'height':148},
{'Size': 'A7','width':74,'height':105},
{'Size': 'A8','width':52,'height':74},
{'Size': 'A9','width':37,'height':52},
{'Size': 'A10','width':26,'height':37},

{'Size': 'B0','width':1000,'height':1414},
{'Size': 'B1','width':707,'height':1000},
{'Size': 'B2','width':500,'height':707},
{'Size': 'B3','width':353,'height':500},
{'Size': 'B4','width':250,'height':353},
{'Size': 'B5','width':176,'height':250},
{'Size': 'B6','width':125,'height':176},
{'Size': 'B7','width':88,'height':125},
{'Size': 'B8','width':62,'height':88},
{'Size': 'B9','width':44,'height':62},
{'Size': 'B10','width':31,'height':44},

{'Size': 'C0','width':917,'height':1297},
{'Size': 'C1','width':648,'height':917},
{'Size': 'C2','width':458,'height':648},
{'Size': 'C3','width':324,'height':458},
{'Size': 'C4','width':229,'height':324},
{'Size': 'C5','width':162,'height':229},
{'Size': 'C6','width':114,'height':162},
{'Size': 'C7','width':81,'height':114},
{'Size': 'C8','width':57,'height':81},
{'Size': 'C9','width':40,'height':57},
{'Size': 'C10','width':28,'height':40},

{'Size': '4A0','width':1682,'height':2378},
{'Size': '2A0','width':1189,'height':1682},

{'Size': 'Letter','width':215.9,'height':279.4},
{'Size': 'Legal','width':215.9,'height':355.6},
{'Size': 'Junior Legal','width':203.2,'height':127},
//{'Size': 'Ledger','width':432,'height':279},
{'Size': 'Tabloid','width':279,'height':432},

{'Size': 'PA4','width':210,'height':280},

{'Size': 'Arch A','width':229,'height':305},
{'Size': 'Arch B','width':305,'height':457},
{'Size': 'Arch C','width':457,'height':610},                           
{'Size': 'Arch D','width':610,'height':914},
{'Size': 'Arch E','width':914,'height':1219},
{'Size': 'Arch E1','width':762,'height':1067},
{'Size': 'Arch E2','width':660,'height':965},
{'Size': 'Arch E3','width':686,'height':991},

{'Size': '2R','width':64,'height':89},
{'Size': 'LD,DSC','width':89,'height':119},
{'Size': '3R,L','width':89,'height':127},
{'Size': 'LW','width':89,'height':133},
{'Size': 'KGD','width':102,'height':136},
{'Size': '4R,KG','width':102,'height':152},
{'Size': '2LD,DSCW','width':127,'height':169},
{'Size': '5R,2L','width':127,'height':178},
{'Size': '2LW','width':127,'height':190},
{'Size': '6R','width':152,'height':203},
{'Size': '8R,6P','width':203,'height':254},
{'Size': 'S8R,6PW','width':203,'height':305},
{'Size': '11R','width':279,'height':356},
{'Size': 'A3+,Super B','width':330,'height':483}
];

STDSizes.sort(function(a, b) {
    return (a.height > b.height) ? -1 : ((b.height > a.height) ? 1 : 0);
});

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

var eps = 1; //size compare tolerance [mm]
for (var i = 0; i < pdfe.SelectedFiles.Count; i++) {
    ProgressBar.position = i + 1;
    pdfe.echo('Processing ' + pdfe.SelectedFiles(i).Filename);
    var PaperSizes = {};
    var Pages = pdfe.SelectedFiles(i).Pages;
    for (var ii = 0; ii < Pages.Count; ii++) {
        var Page = Pages(ii);
        if (Page) {
            var w = Math.min(Page.Width, Page.Height);
            var h = Math.max(Page.Width, Page.Height);
            for (var n = 0; n < STDSizes.length; n++) {
                hdif = h - STDSizes[n].height;
                if (Math.abs(hdif) < eps && Math.abs(w - STDSizes[n].width) < eps) {
                    SizeID = STDSizes[n].Size;
                    if (!PaperSizes[SizeID]) {
                        var PaperSize = clone(STDSizes[n]);
//                        PaperSize.Size += ' (' + PaperSize.width + 'x' + PaperSize.height + ')';
                        PaperSize['count'] = 1;
                        PaperSizes[SizeID] = PaperSize;
                    } else {
                        PaperSizes[SizeID].count += 1;
                    }
                    break;
                } else if (hdif > 0) { //stop search if page height>current stdSize height
                    var SizeID = w.toFixed() + 'x' + h.toFixed();
                    var PaperSize = {
                        'Size': SizeID,
                        'width': Math.floor(w * 10) / 10,
                        'height': Math.floor(h * 10) / 10,
                        'notStd': true
                    }

                    STDSizes.splice(n, 0, PaperSize);
                    PaperSize['count'] = 1;
                    PaperSizes[SizeID] = PaperSize;
                    break;
                }
            }
        }
    }

    //sort descending by page size count. Standard sizes and higher heights first
    PaperSizes = sortObj(PaperSizes, function(a, b) {
        if (a['notStd'] == b['notStd']) {
            return (a.count > b.count) ? -1 : ((b.count > a.count) ? 1 : (a.height > b.height) ? -1 : ((b.height > a.height) ? 1 : 0));
        } else if (!a['notStd']) return -1;
        return 1;
    });

    //output results
    pdfe.echo(pdfe.SelectedFiles(i).Filename, 0, 2);
    pdfe.echo(' Size details:');
    for (var n = 0; n < PaperSizes.length; n++) {
        pdfe.echo('   ' + PaperSizes[n].Size + ' = ' + PaperSizes[n].count);
    }

    var sizesStr='';
    for (var n = 0; n < PaperSizes.length; n++) {
    sizesStr=sizesStr+PaperSizes[n].Size+',';   
    }
    pdfe.echo(' Sizes list: ' + sizesStr.substr(0,sizesStr.length-1));   
   
}

pdfe.echo("Done");

//======================================================================
function clone(obj) {
    if (obj == null || typeof(obj) != 'object') return obj;
    var temp = new obj.constructor();
    for (var key in obj)
    temp[key] = clone(obj[key]);
    return temp;
}

function sortObj(object, sortFunc) {
    var rv = [];
    for (var k in object) {
        if (object.hasOwnProperty(k)) {
            rv.push(object[k]);
        }
    }
    rv.sort(sortFunc);
    return rv;
}

At what point do I modify this sorry to add the information to the metadata? I am trying but struggling  :S
100
Ideas/Suggestions / Re: 6 great new features!
« Last post by RTT on May 26, 2017, 01:03:40 AM »
Maybe making "Portrait" and "Landscape" page selector keywords... :-\
will try it. wasn't in the parameters so didn't think it were possible.
Still not possible. Just me thinking out loud, if this is perhaps the best approach to accomplish this.
Pages: 1 ... 8 9 [10]