Recent Posts

Pages: [1] 2 3 ... 10
1
Ideas/Suggestions / Re: Split multi-page & multi-page.size PDF into respective sizes
« Last post by conrad.drake on September 21, 2017, 07:40:02 AM »
Thanks - I'll give that a go (I've been a little busy for the past week ro so!)
2
Ideas/Suggestions / Re: Split multi-page & multi-page.size PDF into respective sizes
« Last post by RTT on September 12, 2017, 01:54:07 AM »
Using the cropping idea, the next script creates a new PDF with all the A3 pages split into two A4. The split is done by adjusting the media and crop boxes and duplication of the page reference.
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 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('.'));

        pdfe.echo('>' + Filename);

        for (var PageIndex = 0; PageIndex < Pages.Count; PageIndex++) {
            var Page = Pages(PageIndex);
            if (Page) {

                var w = Math.min(Page.Width, Page.Height);
                var h = Math.max(Page.Width, Page.Height);

                //A3=297x420
                if (Math.abs(w - 297) < 15 && Math.abs(h - 420) < 15) {
                    pdfe.echo('  Splitting page ' + (PageIndex + 1).toString());
                    var box = Page.CropBox;
                    if (box.Right - box.Left < box.Top - box.Bottom) {
                        if (Page.Rotation == 90) {
                            var oriBoxTop = box.Top;
                            box.Top = box.Top + (box.Bottom - box.Top) / 2;
                            Page.MediaBox = box;
                            Page.CropBox = box;
                            Merger.MergePage(Page);

                            box.Bottom = box.Top;
                            box.Top = oriBoxTop;
                            Page.MediaBox = box;
                            Page.CropBox = box;
                        } else {
                            var oriBoxBottom = box.Bottom;
                            box.Bottom = box.Top + (box.Bottom - box.Top) / 2;
                            Page.MediaBox = box;
                            Page.CropBox = box;
                            Merger.MergePage(Page);

                            box.Top = box.Bottom;
                            box.Bottom = oriBoxBottom;
                            Page.MediaBox = box;
                            Page.CropBox = box;
                        }
                    } else {
                        if (Page.Rotation == 270) {
                            var oriBoxLeft = box.Left;
                            box.Left = box.Left + (box.Right - box.Left) / 2;
                            Page.MediaBox = box;
                            Page.CropBox = box;
                            Merger.MergePage(Page);

                            box.Right = box.Left;
                            box.Left = oriBoxLeft;
                            Page.MediaBox = box;
                            Page.CropBox = box;
                        } else {
                            var oriBoxRight = box.Right;
                            box.Right = box.Left + (box.Right - box.Left) / 2;
                            Page.MediaBox = box;
                            Page.CropBox = box;
                            Merger.MergePage(Page);

                            box.left = box.right;
                            box.right = oriBoxRight;
                            Page.MediaBox = box;
                            Page.CropBox = box;
                        }
                    }

                }
                Merger.MergePage(Page);
            }
        }

        var NewFilename = Path + Name + '_A3To2A4.pdf';
        if (Merger.EndAndSaveTo(NewFilename)) {
            pdfe.echo('  Saving to: ' + NewFilename + ' [OK]', 0)
        } else {
            pdfe.echo('  Saving to: ' + NewFilename + ' [Failed]', 0xFF0000);
        }

    } catch (e) {
        pdfe.echo(Filename + ' :' + e.message, 0xFF0000);
    }
}

pdfe.echo("Done");
3
Ideas/Suggestions / Re: Split multi-page & multi-page.size PDF into respective sizes
« Last post by conrad.drake on September 11, 2017, 06:31:47 AM »
A variation on the theme: I have some scanned documents, which are a mix of A4 and A3 sheets - the A3 being two pages.

Any suggestions on how I might split the A3 sheets into two A4 sheets?   I could probably fake it with PDF cropping. 

Right now, the scan is a JPEG so my current workflow will be to extract the images and cut these in half with my favourite image editor.

I suspect this is a whole new can-o-worms rather than a simple script.  Any suggestions?
4
General / Re: pdf shell tools / Windows 10
« Last post by RTT on August 20, 2017, 04:36:41 PM »
Just tested, v2.6.3 on Win 10 pro 1703, and I can edit standard, and custom, fields metadata without problem, from the Windows Explorer detail pane, preview pane (using the preview handler tools metadata edit pane) and file properties dialog details and InfoEdit tabs, so all still working as designed.

What's happening in your case? Does it show any error message when saving the changes or the fields are just read only?

Run the manager and recycle the Property Handler extension registration. I.e. uncheck it and apply the changes and then check it and apply the changes again.
Now, using the Windows task manager, select the Windows Explorer process and click the restart button.
5
General / pdf shell tools / Windows 10
« Last post by Philipp on August 20, 2017, 09:14:40 AM »
Hi, I am running pdf shell tools 2.6.3.0 under Win 10 pro v1703. I can view pdf Metadata in details pane or preview metadata section but cannot edit them.
Do I need current version of pdf shell tools in order to work with win 10?
Thanks,
Philipp
6
General / Re: Merge/Split Operation Error
« Last post by RTT on August 16, 2017, 02:14:31 AM »
These values in the registry are just the list of the last used split rules, shown in the tool dialog split rules field combobox drop down list.

When the user is getting that error, does it work clicking the "preview", instead of the "run", button? If yes, check if the "output filename" field is set to generate always the same filename. If that file already exists (from a previous split run) and it is open in the shell preview pane, or another application, that "Operation Failed: Unknown Error" message will fire.
7
General / Re: Merge/Split Operation Error
« Last post by illanetswitch on August 16, 2017, 01:21:21 AM »
Error word for word is:
"Operation Failed: Unknown Error"
(File Path)
8
General / Merge/Split Operation Error
« Last post by illanetswitch on August 16, 2017, 01:14:18 AM »
Strange occurrence, user had started the day utilising the split tool and after an hour (not sure what happened in this window) upon trying to split a pdf they were greeted with an Operation Error which would not allow them to split the file. Upon trying a different account on the same machine, it appeared to work fine. Compared the registry and noticed that under 'HKCU>Software>PDFShellTools>PDFTools>Split' there is a subkey called SplitRules. In this Key there are multiple values called str0, str1, str2 and so forth. Upon deleting these values, I attempt to split a file and it works to succession, tried again with different value (i.e. pages 3-4) and the error came back. This also created a value of str0 with the data set to 3-4.

Not sure how it is supposed to look, does anyone have a copy of what the registry SHOULD look like. Comparing the users registry to my own and noticed some minor differences however we are running different versions. User is on 3.1, I am on 2.6.1
9
Ideas/Suggestions / Re: Allow files to be deleted when using preview pane
« Last post by RTT on August 11, 2017, 04:34:40 PM »
You should be able to delete the file if the preview handler is loaded with the metadata edit panel closed. The shell sends an unload command, when deleting or the file properties dialog is invoked. Sometimes there is the need to click the "file in use" dialog retry button, because the PDF is still unloading.

And I have already coded a solution that fixes this issue, and related for when trying to rename the file, for when the metadata panel is open too. Should be a no issue anymore, with the next release.
10
Ideas/Suggestions / Allow files to be deleted when using preview pane
« Last post by msitekkie on August 11, 2017, 03:03:09 PM »
Currently when you try to delete any PDF file if the view includes the preview window the deletion get's blocked with a message saying the file is open in PDF Shell tools. This is a real nuisance to the point that I actually disable the shell tools preview functionality.

Please update so that PDF Shell tools does not hold the file open, thus allowing PDF files to be deleted.
Pages: [1] 2 3 ... 10