Coming from pdfsam

Differences between sejda and pdfsam shell interface


This page explains the changes between sejda-console (2.10.4) and pdfsam-console (version 2.4.0e).

General changes

Single vs double dashes and short/long option names

In pdfsam-console, options were specified using a single dash character

-version -pages

This is changed in sejda-console, where most options have a short and a long name. You can use the short or the long name when specifying an option. When using the long name, double dashes are required.

--version (or -v) and --pages (or -p)

Camel-case option names

Some option names in sejda have slightly changed compared to pdfsam, in terms of camel-case spelling.


is now changed to


New! Commands (17)

  • pdftomultipletiff: Converts a pdf document to multiple TIFF images (one image per page).
  • pdftosingletiff: Converts a pdf document to a single TIFF image (TIFF format supports multiple images written to a single file).
  • pdftojpeg: Converts a pdf document to multiple Jpeg images (one image per page).
  • extracttext: Given a collection of pdf documents, creates a collection of text files containing text extracted from them.
  • extracttextbypages: Extracts text from a single pdf document creating a collection of text files each containing text extracted from a single page.
  • combinereorder: Combines multiple pdf documents reordering the pages if required.
  • compress: Compress PDF by optimizing images inside, reducing their dpi, size and/or quality.
  • extractbybookmarks: Extract chapters to separate documents based on the bookmarks in the outline at a given level (optionally filtered by a given regex).
  • extractpages: Extract pages from a pdf document creating a new one containing only the selected pages. Page selection can be done using a predefined set of pages (odd, even) or as a set of ranges (from page x to y).
  • splitbytext: Splits document by text content, extracting separate documents when specific text changes from page to page.
  • splitdownthemiddle: Splits document pages in two, reordering pages if necessary.
  • crop: Given a pdf document and a set of rectangular boxes, creates a single output pdf document where pages are cropped according to the input rectangular boxes. Input boxes are set as mediabox and cropbox on the resulting document pages (see Pdf reference 1.7, chapter 3.6.2, TABLE 3.27). Resulting document will have a number of pages that is the the number of pages of the original document multiplied by the number of rectangular boxes.
  • setheaderfooter: Adds a text as header or footer of every page of a given pdf document.
  • attachments collection: Creates a portfolio/collection of attachments.
  • nup: Composes multiple PDF pages (4, 8, 16, 32) per sheet, commonly known as Nup.
  • watermark: Stamps a watermark image on multiple PDF documents.
  • scale: Scale pages or pages content of multiple PDF documents.

Changed Commands

Command Change details
alternatemix Options -f1 and -f2 from pdfsam are now one single option -f in sejda

pdfsam: -f1 file1.pdf -f2 file2.pdf
sejda: -f file1.pdf file2.pdf
Option -step is renamed to --firstStep.
Command name changed from mix to alternatemix

pdfsam: mix [options]
sejda: alternatemix [options]
Command Change details
setpagelabels In pdfsam, option -l specifying the labels in format “pageindex:style:logicalnumber” was accompanied by an optional -lp option specifying the label prefix in format “pageindex:prefix”.
In sejda, the two options were merged into one -l or --labels in format “pageindex:style:logicalnumber:prefix”.

pdfsam: -l 1:uroman:99 -lp 1:Prefix
sejda: -l 1:uroman:99:Prefix
Command Change details
setviewerpreferences New option -duplex: paper handling options to use when printing the file from the print dialog: {simplex, duplex_flip_short_edge, duplex_flip_long_edge}. If ommited it uses ‘simplex’ (optional)
Option (flag) -noPageScaling was changed to (optional) option --pageScaling supporting values ‘none’ and ‘app_default’.

pdfsam: setviewer -noPageScaling 
sejda: setviewerpreferences --pageScaling none
Command name changed from setviewer to setviewerpreferences

pdfsam: setviewer [options]
sejda: setviewerpreferences [options]
Command Change details
split Split command from pdfsam was broken down into 4 separate commands in sejda:

  • simplesplit: Splits a given pdf document at a predefined set of page numbers (all, odd pages, even pages).
  • splitbybookmarks: Splits a given pdf document at pages where exists a GoTo action in the document outline (bookmarks) at the specified level (optionally matching a provided regular expression),
  • splitbypages: Splits a given pdf document at a selected set of page numbers.
  • splitbysize: Splits a given pdf document in files of the selected size (roughly).
Command Change details
merge Option (flag) --addBlanks has been added allowing a blank page addition after each merged document if the number of pages is odd.
New option -bookmarks: let the user decide what to do with the documents outline (bookmarks) of the merged pdf documents. Possible values are {discard, retain, one_entry_each_doc}. If ommited it uses ‘retain’ (optional)