summaryrefslogtreecommitdiff
path: root/src/export
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2021-12-02 17:24:52 +0100
committerMartin Haug <mhaug@live.de>2021-12-02 17:24:52 +0100
commitd971ac9a8c9ca9d528d4798ed799e3fa2b3375fd (patch)
treea01348e41f201577499b2437ad22821df0fca2e3 /src/export
parentbfa9962632dd3c2e9110f9c3667d7e3cf6b133d4 (diff)
Add a producer info for the PDF
Diffstat (limited to 'src/export')
-rw-r--r--src/export/pdf.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/export/pdf.rs b/src/export/pdf.rs
index 94386c99..d3e5b33e 100644
--- a/src/export/pdf.rs
+++ b/src/export/pdf.rs
@@ -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);