Document constructor

Document({
  1. PdfPageMode pageMode = PdfPageMode.none,
  2. DeflateCallback? deflate,
  3. bool compress = true,
  4. bool verbose = false,
  5. PdfVersion version = PdfVersion.pdf_1_5,
  6. ThemeData? theme,
  7. String? title,
  8. String? author,
  9. String? creator,
  10. String? subject,
  11. String? keywords,
  12. String? producer,
  13. XmlDocument? metadata,
})

Implementation

Document({
  PdfPageMode pageMode = PdfPageMode.none,
  DeflateCallback? deflate,
  bool compress = true,
  bool verbose = false,
  PdfVersion version = PdfVersion.pdf_1_5,
  this.theme,
  String? title,
  String? author,
  String? creator,
  String? subject,
  String? keywords,
  String? producer,
  XmlDocument? metadata,
}) : document = PdfDocument(
        pageMode: pageMode,
        deflate: deflate,
        compress: compress,
        verbose: verbose,
        version: version,
      ) {
  if (title != null ||
      author != null ||
      creator != null ||
      subject != null ||
      keywords != null ||
      producer != null) {
    PdfInfo(
      document,
      title: title,
      author: author,
      creator: creator,
      subject: subject,
      keywords: keywords,
      producer: producer,
    );
  }
  if (metadata != null) {
    PdfMetadata(document, metadata);
  }
}