|
iText 9.6.0 API
|
Enforces configurable limits intended to protect PDF reading/parsing against excessive memory consumption. More...
Public Member Functions |
|
| MemoryLimitsAwareHandler () | |
| Creates a MemoryLimitsAwareHandler to handle decompression of PDF streams and other memory-related limits during reading. More... |
|
| MemoryLimitsAwareHandler (long documentSize) | |
| Creates a MemoryLimitsAwareHandler with calculated memory limits for decompression and xref structures based on the provided document size. More... |
|
| virtual iText.Kernel.Pdf.MemoryLimitsAwareHandler | CreateNewInstance () |
| Creates a new instance of MemoryLimitsAwareHandler by copying settings from this instance of MemoryLimitsAwareHandler. More... |
|
| virtual int | GetMaxSizeOfSingleDecompressedPdfStream () |
| Returns the maximum allowed size (in bytes) of a single decompressed PDF stream. More... |
|
| virtual iText.Kernel.Pdf.MemoryLimitsAwareHandler | SetMaxSizeOfSingleDecompressedPdfStream (int maxSizeOfSingleDecompressedPdfStream) |
| Sets the maximum allowed size which can be occupied by a single decompressed pdf stream. More... |
|
| virtual long | GetMaxSizeOfDecompressedPdfStreamsSum () |
| Gets the maximum allowed size which can be occupied by all decompressed pdf streams. More... |
|
| virtual iText.Kernel.Pdf.MemoryLimitsAwareHandler | SetMaxSizeOfDecompressedPdfStreamsSum (long maxSizeOfDecompressedPdfStreamsSum) |
| Sets the maximum allowed size which can be occupied by all decompressed pdf streams. More... |
|
| virtual bool | IsMemoryLimitsAwarenessRequiredOnDecompression (PdfArray filters) |
| Performs a check if the PdfStream with provided setup of the filters requires memory limits awareness during decompression. More... |
|
| virtual int | GetMaxNumberOfElementsInXrefStructure () |
| Gets maximum number of elements in xref structure. More... |
|
| virtual long | GetMaxXObjectsSizePerPage () |
| Gets maximum page size. More... |
|
| virtual void | SetMaxXObjectsSizePerPage (long maxPageSize) |
| Sets maximum page size. More... |
|
| virtual void | SetMaxNumberOfElementsInXrefStructure (int maxNumberOfElementsInXrefStructure) |
| Sets maximum number of elements in xref structure. More... |
|
| virtual void | CheckIfXrefStructureExceedsTheLimit (int requestedCapacity) |
| Performs a check of possible extension of xref structure. More... |
|
| virtual void | CheckIfPageSizeExceedsTheLimit (long totalXObjectsSize) |
Static Package Functions |
|
| static int | CalculateMaxElementsInXref (long documentSizeInBytes) |
| Calculate max number of elements allowed in xref table based on the size of the document, achieving max limit at 100MB. More... |
|
Enforces configurable limits intended to protect PDF reading/parsing against excessive memory consumption.
Enforces configurable limits intended to protect PDF reading/parsing against excessive memory consumption.
The handler is primarily used during decoding (decompression) of PDF streams, but also guards against other potentially unbounded structures during reading, e.g. cross-reference (xref) table growth and per-page XObject usage.
A configured handler can be set on ReaderProperties and will be used by PdfReader when opening a document.
|
inline |
Creates a MemoryLimitsAwareHandler to handle decompression of PDF streams and other memory-related limits during reading.
|
inline |
Creates a MemoryLimitsAwareHandler with calculated memory limits for decompression and xref structures based on the provided document size.
| documentSize | the size of the document (in bytes). |
|
inlinestaticpackage |
Calculate max number of elements allowed in xref table based on the size of the document, achieving max limit at 100MB.
| documentSizeInBytes | document size in bytes. |
|
inlinevirtual |
Performs a check of possible extension of xref structure.
| requestedCapacity | capacity to which we need to expand xref array. |
|
inlinevirtual |
Creates a new instance of MemoryLimitsAwareHandler by copying settings from this instance of MemoryLimitsAwareHandler.
|
inlinevirtual |
Gets maximum number of elements in xref structure.
|
inlinevirtual |
Gets the maximum allowed size which can be occupied by all decompressed pdf streams.
|
inlinevirtual |
Returns the maximum allowed size (in bytes) of a single decompressed PDF stream.
|
inlinevirtual |
Gets maximum page size.
|
inlinevirtual |
|
inlinevirtual |
Sets maximum number of elements in xref structure.
| maxNumberOfElementsInXrefStructure | maximum number of elements in xref structure. |
|
inlinevirtual |
Sets the maximum allowed size which can be occupied by all decompressed pdf streams.
Sets the maximum allowed size which can be occupied by all decompressed pdf streams. This value can be limited by the maximum expected PDF file size when it's completely decompressed. Setting this value correlates with the maximum processing time spent on document reading
iText will throw an exception if during decompression pdf streams which were identified as requiring memory limits awareness occupy more memory than allowed.
| maxSizeOfDecompressedPdfStreamsSum | he maximum allowed size which can be occupied by all decompressed pdf streams. |
|
inlinevirtual |
Sets the maximum allowed size which can be occupied by a single decompressed pdf stream.
Sets the maximum allowed size which can be occupied by a single decompressed pdf stream. This value correlates with maximum heap size. This value should not exceed limit of the heap size.
iText will throw an exception if during decompression a pdf stream which was identified as requiring memory limits awareness occupies more memory than allowed.
| maxSizeOfSingleDecompressedPdfStream | the maximum allowed size which can be occupied by a single decompressed pdf stream. |
|
inlinevirtual |
Sets maximum page size.
| maxPageSize | maximum page size. |