officefileapi-devexpress-dot-pdf-dot-pdfsaveoptions-27afdc45.md
Gets or sets whether to store PDF objects in object streams.
Namespace : DevExpress.Pdf
Assembly : DevExpress.Pdf.v25.2.Core.dll
NuGet Package : DevExpress.Pdf.Core
public bool UseObjectStreams { get; set; }
Public Property UseObjectStreams As Boolean
| Type | Description |
|---|---|
| Boolean |
true to store PDF objects in object streams; otherwise, false.
|
Object streams (PDF 1.5+) allow you to pack multiple PDF objects into a compressed stream to reduce file size.
Set the UseObjectStreams property to true and pass the PdfSaveOptions object to the SaveDocument method to enable object stream compression.
Note
Object streams are not used if they are prohibited by the specified compliance. Among supported compliance standards, only PDF/A-1 (based on PDF 1.4) prohibits object streams.
The following code snippet enables object streams when saving a PDF document:
using DevExpress.Pdf;
using (PdfDocumentProcessor processor = new PdfDocumentProcessor()) {
// Load the document
processor.LoadDocument("Document.pdf");
// Configure save options with object streams
var saveOptions = new PdfSaveOptions() {
UseObjectStreams = true
};
// Save the document with object streams enabled
processor.SaveDocument("Document.compressed.pdf", saveOptions);
}
Imports DevExpress.Pdf
Using processor As New PdfDocumentProcessor()
' Load the document
processor.LoadDocument("Document.pdf")
' Configure save options with object streams
Dim saveOptions As New PdfSaveOptions() With {
.UseObjectStreams = True
}
' Save the document with object streams enabled
processor.SaveDocument("Document.compressed.pdf", saveOptions)
End Using
See Also