Document

Inheritance: java.lang.Object

All Implemented Interfaces: java.io.Closeable

public class Document implements Closeable

Represents document properties

Constructors

Constructor Description
Document(InputStream stream) Initializes new instance of Document class.
Document(InputStream stream, String password) Initializes new instance of Document class.

Methods

Method Description
setCache(ICache value)
getName() Document name
setName(String value) Document name
getStreamSize() Document size
createStream() Creates Document input stream
getPassword() Document password
setPassword(String value)
getRotation() Document Rotation
setRotation(Byte value) Document Rotation
getProcessPages() Document pages
setProcessPages(int value) Document pages
generatePreview(PreviewOptions previewOptions) Generates document pages preview.
getDocumentInfo() Gets information about document - document type and size, pages count etc.
close()
addImageToDocument(String dataDir, String jpgFileName, int pageNumber, int imageQuality) Change image quality and add image to document

Document(InputStream stream)

public Document(InputStream stream)

Initializes new instance of Document class.

Parameters:

Parameter Type Description
stream java.io.InputStream The document stream.

Document(InputStream stream, String password)

public Document(InputStream stream, String password)

Initializes new instance of Document class.

Parameters:

Parameter Type Description
stream java.io.InputStream The document stream.
password java.lang.String The document password.

setCache(ICache value)

public final void setCache(ICache value)

Parameters:

Parameter Type Description
value ICache

getName()

public final String getName()

Document name

Returns: java.lang.String -

setName(String value)

public final void setName(String value)

Document name

Parameters:

Parameter Type Description
value java.lang.String

getStreamSize()

public final long getStreamSize()

Document size

Returns: long -

createStream()

public final InputStream createStream()

Creates Document input stream

Returns: java.io.InputStream

getPassword()

public final String getPassword()

Document password

Returns: java.lang.String

setPassword(String value)

public final void setPassword(String value)

Parameters:

Parameter Type Description
value java.lang.String

getRotation()

public final Byte getRotation()

Document Rotation

Returns: java.lang.Byte -

setRotation(Byte value)

public final void setRotation(Byte value)

Document Rotation

Parameters:

Parameter Type Description
value java.lang.Byte

getProcessPages()

public final int getProcessPages()

Document pages

Returns: int -

setProcessPages(int value)

public final void setProcessPages(int value)

Document pages

Parameters:

Parameter Type Description
value int

generatePreview(PreviewOptions previewOptions)

public final void generatePreview(PreviewOptions previewOptions)

Generates document pages preview.

Parameters:

Parameter Type Description
previewOptions PreviewOptions The document preview options

getDocumentInfo()

public final IDocumentInfo getDocumentInfo()

Gets information about document - document type and size, pages count etc.

Returns: IDocumentInfo -

close()

public void close()

addImageToDocument(String dataDir, String jpgFileName, int pageNumber, int imageQuality)

public void addImageToDocument(String dataDir, String jpgFileName, int pageNumber, int imageQuality)

Change image quality and add image to document

Parameters:

Parameter Type Description
dataDir java.lang.String Specify the path to the input PDF file
jpgFileName java.lang.String The path to the JPG file
pageNumber int Page where the image will be inserted
imageQuality int Set image quality from 1 to 100, “1” - is the smallest resolution “100” - is the largest