Coming from pdfsam

Differences between sejda and pdfsam shell interface

Contents

This page explains the changes between sejda-console (1.0.0.M6) 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.

-reversefirst

is now changed to

--reverseFirst

New! Commands (4)

  • 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).
  • extracttext: Given a collection of pdf documents, creates a collection of text files containing text extracted from them.
  • 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.

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.