Split and Join Commands Added to CLI

the DocumentAlchemy blog

Split and Join Commands Added to CLI

Just a quick note that split and join commands have been added to the DocumentAlchemy command-line interface.


Split a PDF into individual pages

split, based on the /document/{ID}/rendition/pages.zip endpoint, will split a PDF document into individual pages. An optional range parameter can be used to specify pages to include or exclude from the generated archive.

For example, if INPUT.pdf is a 13-page document, then:

document-alchemy split INPUT.pdf --range 3,5-7,11-last --out OUT.zip

will generate a Zip archive (OUT.zip) that contains pages 3, 5, 6, 7 and 11, 12 and 13 or INPUT.pdf.


Join MS Office and PDF files into a single document

join, based on the /documents/{IDs}/rendition/combined.pdf endpoint, will combine a collection of Microsoft Office (Word, Excel, PowerPoint) and PDF documents into a single PDF.

For example:

document-alchemy join F1.docx F2.pdf F3.xls --out OUT.pdf

will generate a PDF document (OUT.pdf) that contains the content of the Word document F1.docx, the PDF document F2.pdf and the Excel spreadsheet F3.xls.


This brings the total number of command supported in the most recent stable release of the DocumentAlchemy command-line application (v1.2.1) to six:

  • capture - capture a screenshot
  • convert - convert a file into a different format or rendition
  • join - combine two or more files into a single PDF
  • qrcode - generate a QR code
  • split - break a PDF document into collection of individual pages
  • transform - transform an image


About document-alchemy-cli

The DocumentAlchemy command-line interface is an open-source, command-line client to DocumentAlchemy's RESTful document processing API. It can be found on GitHub as DocumentAlchemy/document-alchemy-cli. It provides a convenient way to invoke the DocumentAlchemy API and an example of a DocumentAlchemy API client implemented in JavaScript (Node.js).

(For more examples of how to create DocumentAlchemy API clients in a number of different technology stacks, see DocumentAlchemy/sample-code, also at GitHub.)

About DocumentAlchemy

DocumentAlchemy is a RESTful web service that developers can use to add document generation, conversion and processing features to their app.

Visit our live demonstrations or interactive API reference to explore Document Alchemy's rapidly growing API for working with MS Office documents, PDFs, images, web pages and more.

Copyright © 2018 DocumentAlchemy.