From 3d65a96e6db60eacd9c4bc17ecc13f01ed83c2ef Mon Sep 17 00:00:00 2001 From: Laurenz Stampfl <47084093+LaurenzV@users.noreply.github.com> Date: Mon, 28 Oct 2024 23:06:07 +0100 Subject: [PATCH] Add API for setting display doc title --- src/structure.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/structure.rs b/src/structure.rs index a5def42..e1c4801 100644 --- a/src/structure.rs +++ b/src/structure.rs @@ -269,6 +269,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