Compatibility
- 1.0.0 and master5.35.25.15.04.2
- 1.0.0 and masteriOSmacOS(Intel)macOS(ARM)LinuxtvOSwatchOS
A library / executable for separating PDF pages into multiple smaller files.
A command line tool for separating the pages of a PDF file into multiple smaller files. The underlying API is also available, should you want to include it in your development projects.
$ docslice ~/Desktop/Filename.pdf -s 2
USAGE: docslice [--output <output>] [--slices <slices>] <file>
ARGUMENTS:
<file> A local PDF file.
OPTIONS:
-o, --output <output> The destination folder for output. (default: current dir))
-s, --slices <slices> The number of parts the document should be evenly split into. (default: 1)
-h, --help Show help information.
import Files // github.com:JohnSundell/Files
let output = Folder.home
let file = File(path: "~/myfile.pdf")
let slice = Slice(file: file, slices: 2, output: output)
try slice.run()
Install Swift (at least version 5.3) then run the following commands.
$ git clone https://github.com/nashysolutions/DocSlice.git
$ cd DocSlice
$ swift build -c release
$ cd .build/release
$ cp -f docslice /usr/local/bin/docslice
If you have any issues with unix directories this article might be helpful.
Slice
API as a Dependencylet package = Package(
platforms: [
.iOS(.v13),
.macOS(.v10_13)
]
dependencies: [
.package(name: "DocSlice", url: "https://github.com/nashysolutions/DocSlice.git", .upToNextMinor(from: "1.0.0"))
],
targets: [
.target(
name: "MyTool",
dependencies: [
.product(name: "Slice", package: "DocSlice")
])
]
)