Document
Leave feedback
On this page
Inheritance: java.lang.Object
All Implemented Interfaces: java.io.Closeable
public class Document implements Closeable
Represents document properties
| Constructor | Description |
|---|---|
| Document(InputStream stream) | Initializes new instance of Document class. |
| Document(InputStream stream, String password) | Initializes new instance of Document class. |
| 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 |
public Document(InputStream stream)
Initializes new instance of Document class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| stream | java.io.InputStream | The document stream. |
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. |
public final void setCache(ICache value)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | ICache |
public final String getName()
Document name
Returns: java.lang.String -
public final void setName(String value)
Document name
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.String |
public final long getStreamSize()
Document size
Returns: long -
public final InputStream createStream()
Creates Document input stream
Returns: java.io.InputStream
public final String getPassword()
Document password
Returns: java.lang.String
public final void setPassword(String value)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.String |
public final Byte getRotation()
Document Rotation
Returns: java.lang.Byte -
public final void setRotation(Byte value)
Document Rotation
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.Byte |
public final int getProcessPages()
Document pages
Returns: int -
public final void setProcessPages(int value)
Document pages
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | int |
public final void generatePreview(PreviewOptions previewOptions)
Generates document pages preview.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| previewOptions | PreviewOptions | The document preview options |
public final IDocumentInfo getDocumentInfo()
Gets information about document - document type and size, pages count etc.
Returns: IDocumentInfo -
public void close()
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 |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.