public class PdfContent extends Content implements IEncryptable
Learn more:
| Constructor and Description |
|---|
PdfContent(StreamContainer stream,
StrategyManager<Integer> strategyManager,
PdfLoadOptions pdfLoadOptions,
WatermarkerSettings watermarkerSettings) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Watermark watermark,
WatermarkOptions options) |
void |
addAnnotationWatermark(Watermark watermark,
boolean isPrintOnly) |
void |
addArtifactWatermark(Watermark watermark) |
void |
decrypt()
Decrypts the content.
|
protected void |
dispose(boolean disposing)
Releases all resources used by the
PdfContent |
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.
|
void |
generatePreview(PreviewOptions previewOptions) |
com.aspose.pdf.Document |
getAsposePdfDocument() |
PdfAttachmentCollection |
getAttachments()
Gets the collection of all attachments of this
. |
IDocumentInfo |
getDocumentInfo() |
FileType |
getFileType() |
int |
getPageMarginType()
Gets pdf page margins to be used during watermark adding.
|
PdfPageCollection |
getPages()
Gets the collection of all pages of this
. |
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 |
performSave(String filePath) |
void |
performSave(String filePath,
SaveOptions saveOptions) |
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.
|
close, dispose, getInfo, getInfo, getSearchableObjects, getStream, getWatermarkerSettings, registerDisposableResource, save, save, save, save, setSearchableObjectsaddWatermark, afterWatermarkAdding, checkWatermarkingLicenseRestrictions, findImages, findImages, getParts, getSearchWatermarksInParts, getStrategyManager, getTopParent, search, search, setParts, tryGetWatermarkerSettingspublic PdfContent(StreamContainer stream, StrategyManager<Integer> strategyManager, PdfLoadOptions pdfLoadOptions, WatermarkerSettings watermarkerSettings)
public void add(Watermark watermark, WatermarkOptions options)
public final void addAnnotationWatermark(Watermark watermark, boolean isPrintOnly)
public final void addArtifactWatermark(Watermark watermark)
public final void decrypt()
Decrypts the content.
decrypt in interface IEncryptableprotected void dispose(boolean disposing)
Releases all resources used by the PdfContent
public final void encrypt(String password)
Encrypts the document using the same password as user password and owner password.
encrypt in interface IEncryptablepassword - 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 void generatePreview(PreviewOptions previewOptions)
generatePreview in class Contentpublic final com.aspose.pdf.Document getAsposePdfDocument()
public final PdfAttachmentCollection getAttachments()
PdfContent.PdfContent.public IDocumentInfo getDocumentInfo()
getDocumentInfo in class Contentpublic FileType getFileType()
getFileType in class Contentpublic final int getPageMarginType()
This property works only when
is true. If Watermark.getConsiderParentMargins() is false,
when pdf CropBox is used as watermarking area.
Watermark.getConsiderParentMargins()
The default value is .PdfPageMarginType.TrimBox
public final PdfPageCollection getPages()
PdfContent.PdfContent.public void performSave(OutputStream stream)
Saves the document data to the specified stream.
performSave in class Contentstream - 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 Contentstream - The stream to save the content data to.saveOptions - The options tha should be used when saving the content data.public void performSave(String filePath)
performSave in class Contentpublic void performSave(String filePath, SaveOptions saveOptions)
performSave in class Contentpublic 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 final void setPageMarginType(int value)
This property works only when
is set to true. If Watermark.getConsiderParentMargins() is false,
when pdf CropBox is used as watermarking area.
Watermark.getConsiderParentMargins()
The default value is .PdfPageMarginType.TrimBox
Copyright © 2026. All rights reserved.