---
Product: Aspose.PDF
Platform: java
Page Type: docs
Canonical URL: https://docs.aspose.org/pdf/java/developer-guide/writer
---

# PDF Writer

Low-level PDF serialization with PDFWriter and PDFEncryptor in Aspose.PDF FOSS for Java.

## PDFWriter

`PDFWriter` serializes the in-memory COS object graph to a PDF byte stream, generating
the cross-reference table, object streams, and file trailer.

## PDFEncryptor

`PDFEncryptor` applies PDF-level encryption to a document stream using the configured
key derivation and cipher parameters from `PDFKeyDerivation` and `PDFEncryptionDict`.

## PDFDecryptor

`PDFDecryptor` removes encryption from a PDF byte stream when the correct decryption
key is available, producing a cleartext document for further processing.

## Usage

These low-level classes are used internally by the `Document` class during `save()`
operations. Direct use is appropriate for custom serialization pipelines or when
applying encryption at the byte stream level independently of the `Document` API.

## See Also

- [Aspose.PDF for Java — Enterprise Documentation](https://docs.aspose.com/pdf/java/)