Add a producer info for the PDF

This commit is contained in:
Martin Haug 2021-12-02 17:24:52 +01:00
parent bfa9962632
commit d971ac9a8c

View File

@ -9,7 +9,9 @@ use image::{DynamicImage, GenericImageView, ImageFormat, ImageResult, Rgba};
use pdf_writer::types::{
ActionType, AnnotationType, CidFontType, ColorSpace, FontFlags, SystemInfo,
};
use pdf_writer::{Content, Filter, Finish, Name, PdfWriter, Rect, Ref, Str, UnicodeCmap};
use pdf_writer::{
Content, Filter, Finish, Name, PdfWriter, Rect, Ref, Str, TextStr, UnicodeCmap,
};
use ttf_parser::{name_id, GlyphId, Tag};
use super::subset;
@ -312,6 +314,11 @@ impl<'a> PdfExporter<'a> {
resources.finish();
pages.finish();
// The document information.
let mut doc_info = self.writer.document_info(self.alloc.bump());
doc_info.creator(TextStr("Typst"));
doc_info.finish();
// The document catalog.
let catalog_ref = self.alloc.bump();
self.writer.catalog(catalog_ref).pages(page_tree_ref);