Recent Posts

Pages: 1 ... 5 6 [7] 8 9 10
61
Ideas/Suggestions / Extract/Split File Into Two Files
« Last post by nightslayer23 on August 12, 2021, 02:08:01 PM »
The extract / split allows you to only split files out into one file... what about if you want to split a file out into multiple files?

File 1 [pages: 1-270]
File 2 [pages: 3241-3374]

Pages would always vary..
62
General / Re: trim + bleed size
« Last post by RTT on July 13, 2021, 05:46:27 AM »
As with the Displaying PDF Page Size in Windows Explorer example, use the manager to create the 3 custom properties, named ArtSize, TrimSize and BleedSize.
Import and run the attached script to calculate and fill these properties, before they can show in the respective Windows File Explorer columns.
Code: [Select]
var ProgressBar = pdfe.ProgressBar;
ProgressBar.max = pdfe.SelectedFiles.Count;

for (var i = 0; i < pdfe.SelectedFiles.Count; i++) {
    ProgressBar.position = i + 1;
    var file = pdfe.SelectedFiles(i);
    var Page = file.Pages(0);
    var TrimSize = '';
    var BleedSize = '';
    var ArtSize = '';
    if (Page) {
        var TrimBox = Page.TrimBox ? Page.TrimBox : Page.CropBox ? Page.CropBox : Page.MediaBox;
        var BleedBox = Page.BleedBox ? Page.BleedBox : Page.CropBox ? Page.CropBox : Page.MediaBox;
        var ArtBox = Page.ArtBox ? Page.ArtBox : Page.CropBox ? Page.CropBox : Page.MediaBox;

        if (Page.Rotation == 90 || Page.Rotation == 270) {
            TrimSize = GetDist_mm(TrimBox.top, TrimBox.bottom).toFixed() + 'x' + GetDist_mm(TrimBox.left, TrimBox.right).toFixed() + ' mm';
            ArtSize = GetDist_mm(ArtBox.top, ArtBox.bottom).toFixed() + 'x' + GetDist_mm(ArtBox.left, ArtBox.right).toFixed() + ' mm';
        } else {
            TrimSize = GetDist_mm(TrimBox.left, TrimBox.right).toFixed() + 'x' + GetDist_mm(TrimBox.top, TrimBox.bottom).toFixed() + ' mm';
            ArtSize = GetDist_mm(ArtBox.left, ArtBox.right).toFixed() + 'x' + GetDist_mm(ArtBox.top, ArtBox.bottom).toFixed() + ' mm';
        }

        var BleedSize = GetDist_mm(BleedBox.top, TrimBox.top).toFixed() + ' mm';

        var FileMetadata = file.Metadata;
        var Changed = false;
        if (FileMetadata.TrimSize !== TrimSize) {
            FileMetadata.TrimSize = TrimSize;
            Changed = true;
        }

        if (FileMetadata.ArtSize !== ArtSize) {
            FileMetadata.ArtSize = ArtSize;
            Changed = true;
        }

        if (FileMetadata.BleedSize !== BleedSize) {
            FileMetadata.BleedSize = BleedSize;
            Changed = true;
        }

        if (Changed) {
            if (FileMetadata.CommitChanges()) {
                pdfe.echo(file.Filename + ' : (ArtSize=' + ArtSize + ', TrimSize=' + TrimSize + ', BleedSize=' + BleedSize + ') [OK]');

            } else {
                pdfe.echo(file.Filename + ' [commit failed]', 0xFF0000);
            }
        } else {
            pdfe.echo(file.Filename + ' : (ArtSize=' + ArtSize + ', TrimSize=' + TrimSize + ', BleedSize=' + BleedSize + ') [properties already set]');
        }
    }
}
pdfe.echo("Done");

function GetDist_mm(x1, x2) {
    return Math.abs(x1 - x2) * 25.4 / 72
}
63
Ideas/Suggestions / Re: Insert/Append Script for inserting one page over and over
« Last post by RTT on July 05, 2021, 03:35:16 PM »
I don't think Windows has a way to add custom shortcuts to File Explorer, or to shell context menu items.
But using the PDF-ShellTools command line interface, and some Windows tricks, this is doable.

  • Extract the attached .js script to a work folder.
  • Open it in a text editor and check if the path to the PDFShellTools.exe is pointing to where you have it on your system. Change accordingly.
  • Create a shortcut to CallShellTools.js, i.e. right click the CallShellTools.js file and execute the "create shortcut" option.
  • Cut the created shortcut and paste it in a Start Menu folder (How to Open the Start Menu Folder), e.g. in the PDF-ShelTools program group folder, C:\ProgramData\Microsoft\Windows\Start Menu\Programs\PDF-ShellTools.
  • Open the shortcut properties dialog and edit the "shortcut key" to enter the shortcut you want to use, and add the command line arguments to the "Target" field.
Examples:
To call the Merge tool, add Merge to the target field
To call a script named "Print Arguments", add RunScript "ScriptName=Print Arguments" to the target field.

Now you just need to select, in the Windows File Explorer, the PDF files you want to process, and press the keyboard shortcut you assigned.

You can repeat the process to create shortcuts to all the other tasks you use often.
64
General / Re: trim + bleed size
« Last post by nightslayer23 on July 05, 2021, 01:50:22 AM »
This is a handy Script! Could it be tweaked to instead of adding the bleed or trim box size to the filename, but add it to a custom handle in explorer?

TRIM BOX
BLEED BOX
ART BOX

All go to their own respective Property Handler ? (no filename change)
65
next update I assume?
Probably.

Quote
is there a way of creating shortcut commands for tasks?
Windows global shortcut? What tasks? Please give me more details about what you are referring to.

for scripts and options from your menu
66
Ideas/Suggestions / Re: Insert/Append Script for inserting one page over and over
« Last post by RTT on June 30, 2021, 05:43:15 PM »
next update I assume?
Probably.

Quote
is there a way of creating shortcut commands for tasks?
Windows global shortcut? What tasks? Please give me more details about what you are referring to.
67
GREAT! next update I assume?

also, is there a way of creating shortcut commands for tasks?
68
Ideas/Suggestions / Re: Insert/Append Script for inserting one page over and over
« Last post by RTT on June 28, 2021, 02:37:34 PM »
The page to insert will always be a single page, to be added in as the even (or back page) to the original file.
I'm going to change the insert/append pages tool to accept multiple insert indexes (current "insert point page" column), with support to index expressions (odd, even, Xn, etc.). This way it will be possible to do multiple inserts withing one run.

Quote
Second scenario: both files will be the same page count, eg 36 Fronts.pdf 36 backs.pdf, and they'd be combined as Odds (fronts) Evens (backs) > output.pdf
This interleave functionality is already possible with the merge tool. Just set for merging the fronts and backs PDFs and check the "merging sequencing through documents in the list" option. You can use the copies column to set the "back" pages to match the number of pages of the fronts one.
69
Apologies - i meant pdf file. Unsure what happened there :Z

Perhaps two scenarios..

The page to insert will always be a single page, to be added in as the even (or back page) to the original file.

Second scenario: both files will be the same page count, eg 36 Fronts.pdf 36 backs.pdf, and they'd be combined as Odds (fronts) Evens (backs) > output.pdf

If for instance one file was a different count to the other, blank pages could be added?

The first scenario is the main application though. it basically works in the opposite to the current Insert/Append function, whereby instead of in the box "pages to include" being able to enter "odd" "even" "all" etc, the insert/append info section allows for the original file to say "after each page"
70
Ideas/Suggestions / Re: Insert/Append Script for inserting one page over and over
« Last post by RTT on June 24, 2021, 03:13:39 PM »
"zip file" ?
If any of these PDFs have more than one page, show me an example with page indexes, so I can better understand the goal.
Pages: 1 ... 5 6 [7] 8 9 10