DocSlice

1.0.0

A library / executable for separating PDF pages into multiple smaller files.
nashysolutions/DocSlice

What's New

Initial release

2021-02-21T08:52:49Z

DocSlice

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.

Usage

$ docslice ~/Desktop/Filename.pdf -s 2

Man Page

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.

Slice API

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()

Installation

Install Swift (at least version 5.3) then run the following commands.

$ git clone https://github.com/Nash-Engineering/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.

Adding underlying Slice API as a Dependency

let package = Package(
    platforms: [
        .iOS(.v13), 
        .macOS(.v10_13)
    ]
    dependencies: [
        .package(name: "DocSlice", url: "https://github.com/Nash-Engineering/DocSlice.git", .upToNextMinor(from: "1.0.0"))
    ],
    targets: [
        .target(
            name: "MyTool", 
            dependencies: [
                .product(name: "Slice", package: "DocSlice")
            ])
    ]
)

Description

  • Swift Tools 5.3.0

Dependencies

Last updated: Mon Feb 22 2021 22:13:34 GMT-0500 (GMT-05:00)