public class PdfContent extends Content
Represents a pdf document where a watermark can be placed.
Modifier and Type | Method and Description |
---|---|
void |
decrypt()
Decrypts the content.
|
void |
encrypt(String password)
Encrypts the document using the same password as user password and owner password.
|
void |
encrypt(String userPassword,
String ownerPassword,
int permissions,
int cryptoAlgorithm)
Encrypts the content.
|
PdfAttachmentCollection |
getAttachments()
Gets the collection of all attachments of this
PdfContent . |
int |
getPageMarginType()
Gets pdf page margins to be used during watermark adding.
|
PdfPageCollection |
getPages()
Gets the collection of all pages of this
PdfContent . |
void |
performSave(OutputStream stream)
Saves the document data to the specified stream.
|
void |
performSave(OutputStream stream,
SaveOptions saveOptions)
Saves the document data to the specified stream.
|
void |
rasterize(int horizontalResolution,
int verticalResolution,
int imageFormat)
Converts all content pages into images.
|
void |
setPageMarginType(int value)
Sets pdf page margins to be used during watermark adding.
|
findImages, findImages, search, search
public final PdfPageCollection getPages()
Gets the collection of all pages of this PdfContent
.
PdfContent
.public final PdfAttachmentCollection getAttachments()
Gets the collection of all attachments of this PdfContent
.
PdfContent
.public final int getPageMarginType()
Gets pdf page margins to be used during watermark adding.
This property works only when Watermark.ConsiderParentMargins
is set to true.
If Watermark.ConsiderParentMargins
is false, when pdf CropBox is used as
watermarking area.
Pdf.PdfPageMarginType.TrimBox
.public final void setPageMarginType(int value)
Sets pdf page margins to be used during watermark adding.
This property works only when Watermark.ConsiderParentMargins
is set to true.
If Watermark.ConsiderParentMargins
is false, when pdf CropBox is used as
watermarking area.
value
- Pdf page margins to be used during watermark adding.
The default value is Pdf.PdfPageMarginType.TrimBox
.public final void encrypt(String password)
Encrypts the document using the same password as user password and owner password.
password
- User and owner password.public final void encrypt(String userPassword, String ownerPassword, int permissions, int cryptoAlgorithm)
Encrypts the content.
userPassword
- User password.ownerPassword
- Owner password.permissions
- Content permissions.cryptoAlgorithm
- Cryptographic algorithm.public final void decrypt()
Decrypts the content.
public final void rasterize(int horizontalResolution, int verticalResolution, int imageFormat)
Converts all content pages into images.
horizontalResolution
- Horizontal image resolution.verticalResolution
- Vertical image resolution.imageFormat
- Image format.public void performSave(OutputStream stream)
Saves the document data to the specified stream.
performSave
in class Content
stream
- The stream to save the content data to.public void performSave(OutputStream stream, SaveOptions saveOptions)
Saves the document data to the specified stream.
performSave
in class Content
stream
- The stream to save the content data to.saveOptions
- The options tha should be used when saving the content data.Copyright © 2020. All rights reserved.