Tutorial

Sejda shell interface tutorial

Contents

Requirements

The shell interface requires Java runtime 1.8 or older to be installed. It works on Linux, Windows and Mac.

Running the shell interface

After you dowloaded the sejda-console binaries and extracted the files, you should have the following directory structure:

./lib
./lib/[...].jar
./bin
./bin/sejda-console.bat
./bin/sejda-console
./etc
./etc/logback.xml

On linux and mac you might have to grant execution permission for the executable file first:

chmod +x bin/sejda-console

To run the console, simply execute the binary file in /bin folder. Choose the binary executable depending on your platform: windows – sejda-console.bat, linux and mac – sejda-console.

./bin/sejda-console

Detailed instructions can be found in this video tutorial.

Available commands

To list the available commands, run the console without any parameters, or with -h option.

> ./bin/sejda-console
09:37:50.614 Configuring Sejda 2.0.0.M1
09:37:50.629 Loading Sejda configuration form default sejda.xml
09:37:50.763 Starting execution with arguments: ''
09:37:50.764 Java version: '1.8.0_60'
09:37:50.781 Sejda Console

Basic commands:

 alternatemix         Given two pdf documents, creates a single output pdf
                      document taking pages alternatively from the two input.
                      Pages can be taken in straight or reverse order and using a
                      configurable step (number of pages before the process switch
                      from a document to the other).

 combinereorder       Combines multiple pdf documents reordering the pages if
                      required.

 compress             Compress PDF by optimizing images inside, reducing their
                      dpi, size and/or quality.

 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.

 decrypt              Given a collection of encrypted pdf documents and their
                      owner password, creates a decrypted version of each of them.

 encrypt              Given a collection of pdf documents, applies the selected
                      permission using the selected encryption algorithm and the
                      provided owner and user password.

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

 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.

 merge                Given a collection of pdf documents, creates a single output
                      pdf document composed by the selected pages of each input
                      document taken in the given order.

 pdftojpeg            Converts a pdf document to multiple JPEG images (one image
                      per page).

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

 rotate               Apply page rotation to a collection of pdf documents.
                      Rotation can be applied to a specified set of pages or to a
                      predefined set (all, even pages, odd pages).

 setheaderfooter      Adds a header or a footer to a pdf document or part of it.

 setmetadata          Apply new metadata (title, author, subject, keywords) to an
                      input pdf document.

 setpagelabels        Given a collection of pdf documents, applies the selected
                      page labels as defined in the Pdf reference 1.7, chapter
                      8.3.1.

 setpagetransitions   Given a pdf document, applies the selected pages transitions
                      (to use the document as a slide show presentation) as
                      defined in the Pdf reference 1.7, chapter 8.3.3.

 setviewerpreferences Given a collection of pdf documents, applies the selected
                      viewer preferences.

 simplesplit          Splits a given pdf document at a predefined set of page
                      numbers (all, odd pages, even pages).

 splitbybookmarks     Splits a given pdf document before each page where exists a
                      GoTo action in the document outline (bookmarks) at the
                      specified level (optionally matching a provided regular
                      expression).

 splitbyevery         Splits a given pdf document every 'n' pages creating
                      documents of 'n' pages each.

 splitbypages         Splits a given pdf document after each one of the selected
                      page numbers.

 splitbysize          Splits a given pdf document in files of the selected size
                      (roughly).

 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.

 unpack               Unpacks all the attachments of a given collection of pdf
                      documents.

Use "sejda-console <command> -h" for help regarding a specific command

Command specific options

To get more details regarding one specific command, run sejda-console -h <command>

> ./bin/sejda-console -h decrypt
09:39:48.310 Given a collection of encrypted pdf documents and their owner password, creates a decrypted version of each of them.

Example usage: sejda-console decrypt -f /tmp/file1.pdf:secret123 -o /tmp -p decrypted_

Usage: sejda-console decrypt options
	[--compressed] : compress output file (optional)
	--existingOutput -j value : policy to use when an output file with the same name already exists. {overwrite, skip, fail}. Default is 'fail' (optional)
	--files -f value... : pdf files to operate on: a list of existing pdf files (EX. -f /tmp/file1.pdf or -f /tmp/password_protected_file2.pdf:secret123) (required)
	[--help -h] : prints usage information. Can be used to detail options for a command '-h command' (optional)
	--output -o value : output directory (required)
	--outputPrefix -p value : prefix for the output files name (optional)
	--pdfVersion -v value : pdf version of the output document/s {1.2, 1.3, 1.4, 1.5, 1.6 or 1.7}. Default is 1.6. (optional)

Configuring custom logging

By default, the sejda-console logs to STDOUT on level INFO.

Logging settings can be changed by editing the etc/logback.xml file

For example, in order to turn off logging completely, simply comment out the STDOUT appender

<root level="INFO">
	<!-- <appender-ref ref="STDOUT" /> -->
	<!-- <appender-ref ref="FILE" /> -->
</root>

Inside the logback.xml file there is an (commented out) example on how to configure the logging to a log file instead of STDOUT.

Configuring memory arguments

By default, the shell interface is configured to use 256Mb memory. If you encounter an OutOfMemoryError you can configure a higher value than the provided default.

On Linux/Mac edit bin/sejda-console

EXTRA_JVM_ARGUMENTS="-Xmx256M"

On Windows edit bin/sejda-console.bat

set EXTRA_JVM_ARGUMENTS=-Xmx256M
Hope solo frappening May andersen leaked Elisha cuthbert leaked nude Sexy leaked nudes Celebrity leaked naked photos Nicki minaj leaked porn pics Emily bett rickards leaked nude Hanna alstrom hacked Selena gomez nude leaks Selena gomez leaked naked pictures Nicki minaj sextape leak Leelee sobieski leak Kate upton leaked naked Cassie leaked Rihhanna thefappening Leaked photo of kate upton The fapenings Free celebrity sex tapes leaked Thefappenings.so Trey songz leaked photos Leaked nude rita ora Abigal spencer leaked naked photos Renee olstead leaked Leaked celebrity photos 2014 pictures Celeb icloud hacked pics Hope solo leaked nudes Emma watson leaked photos Where to find celeb hacked photos Gabrielle union hacked nude i Brie larson hacked photos Olivia holt leaked Bar rafeli leaked nude pic Leelee sobieski leaked nudes Leaked rihanna photo Hayley william fappening Hope solo hacked nude pics Meagan good nude leaked pics Scarlett johansson nude pics leaked Rachel nichols leaked nude photos Leakedandfamous.com