Pages Extraction Script #4327
Replies: 5 comments 3 replies
-
|
Not bad but you can use one cmd line to extract a single page or a whole file without slower VBS as an intermediate. Using |
Beta Was this translation helpful? Give feedback.
-
|
Your suggestion is a bit ambiguous - would it ask for page ranges (e.g. 10,17-20) and destination file (e.g. r:\lamium.pdf) ? (On a side note I would say though that VBS isn't slow; one of its virtues is it is very responsive, and here allows you to customise responses such as output name.) d |
Beta Was this translation helpful? Give feedback.
-
|
I should add that I updated that script a little since, as follows, it now allows for options and handles a few extra situations to my needs, so *L at the end won't launch, lack of a path will prefix with r:\ path, pdf will be added if absent, that allows for better handling of just typing in a pathless title; I also have a few name intercepts which I've removed from this - |
Beta Was this translation helpful? Give feedback.
-
|
I'm not sure what system pdftk.exe uses but I've used it thousands of times and not once had any issue arising unless the file was a protected one. At any rate definitely people should treat the script as a template and adjust as they need, I'm sure they would do so anyway! |
Beta Was this translation helpful? Give feedback.
-
|
@meteorquake Just for your info and perhaps critique I have written a PDF page extractor for call with current file or use standalone via sendto or drag and drop.
I have uploaded that modified script as https://github.com/GitHubRulesOK/SumatraPDF-Plus/blob/master/Plus/ExportPages.cmd note cpdf has a wide set of page descriptions like export some portrait pages in a range or just the landscape ones all in the manual at https://www.coherentpdf.com/cpdfmanual.pdf#page=22 1.3 Input Ranges It needs a writable folder such as "plus" below the SumatraPDF.exe location so ideally a portable variant. The command as written pauses with consoles for initial use "customisation" To see WHY CPDF is best look at an example in #4738 (comment) |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I thought this script I made might be helpful for anyone who wants to save extracts of what they have open in Sumatra directly from Sumatra.
If you have or put pdftk.exe on your system (it often is there from other installed programs) then, the following will add a menu item to extract page ranges (which can be gapped ranges) - you need to change 'D:\Scripts\pdf-extract.vbs' to wherever you put the script -
and the script itself as follows which can be saved somewhere, and tweaked however you wish, you can also add it to the explorer "Send To" menu using the same command line as you used just above (for that, run shell:sendto to get to that folder), you will need to change 'C:\Unreg\PdftkBuilderEnhanced\pdftk.exe' to be the location of pdftk.exe on your computer -
Beta Was this translation helpful? Give feedback.
All reactions