From 22e39a3d3fc9e7fe1fd6c94add088aef5fc0e645 Mon Sep 17 00:00:00 2001 From: Laurenz Stampfl <47084093+LaurenzV@users.noreply.github.com> Date: Wed, 30 Oct 2024 13:23:53 +0100 Subject: [PATCH] Add API for setting display doc title (#46) --- src/structure.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/structure.rs b/src/structure.rs index 900cb6d..4f9ab5c 100644 --- a/src/structure.rs +++ b/src/structure.rs @@ -290,6 +290,14 @@ impl<'a> ViewerPreferences<'a> { self } + /// Write the `/DisplayDocTitle` attribute to set whether the viewer should + /// display the document's title from the `Title` entry as the window's title. + /// PDF 1.4+ + pub fn display_doc_title(&mut self, display: bool) -> &mut Self { + self.pair(Name(b"DisplayDocTitle"), display); + self + } + /// Write the `/NonFullScreenPageMode` attribute to set which chrome /// elements the viewer should show for a document which requests full /// screen rendering in its catalog when it is not shown in full screen