# IPdfwriter

IPdfWriter abstract class provides interface for pdf content writing.

IPdfWriter writes pdf content in two phases:

- Real data writing and information collecting. This is done during `writeContent` method. Implementator is responsible to collect all data needed for cross reference section generation.
- Cross reference section writing. This is done in `writeTrailer` method, which gets all collected data and writes cross reference table (or stream - depends on implementation), writes trailer dictionary and finally information about last xref position.

Different implementator of IPdfWriter interface can be set by `XRefWriter::setPdfWriter` method.

Each sequence of `writeContent, [writeContent, ]* writeTrailer` forms new revision of document in incremental update sense. In this moment `OldStylePdfWriter` implementation is used which forms old style cross reference table (see pdf specification 2.4.3 Cross reference table chapter).