From 66263238e76cde4fe9da1a5f03e872b30254a8cb Mon Sep 17 00:00:00 2001 From: Marc Stober Date: Mon, 18 Sep 2023 10:46:11 -0400 Subject: [PATCH 1/2] DOC: Fix typos and add a paragraph to ViewerPreferences docs. --- docs/user/viewer-preferences.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/user/viewer-preferences.md b/docs/user/viewer-preferences.md index d242bcae8..e5bd0c0ba 100644 --- a/docs/user/viewer-preferences.md +++ b/docs/user/viewer-preferences.md @@ -3,7 +3,7 @@ It is possible to set viewer preferences of the PDF file. These properties are described in Section 12.2 of the [PDF 1.7 specification](https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf). -Note that the `\ViewerPreferences` dictionary does not exist by default. +Note that the `/ViewerPreferences` dictionary does not exist by default. If it's not already present, it must be created by calling the `create_viewer_preferences` method of the `PdfWriter` object. @@ -41,7 +41,7 @@ writer.viewer_preferences.non_fullscreen_pagemode = "/UseThumbs" writer.viewer_preferences.non_fullscreen_pagemode = "/UseOC" # /Direction -writer.viewer_preferences.direction = "/L2R" # default, +writer.viewer_preferences.direction = "/L2R" # default writer.viewer_preferences.direction = "/R2L" # /ViewArea @@ -77,3 +77,7 @@ for i in range(40): with open("output.pdf", "wb") as output_stream: writer.write(output_stream) ``` + +(The names beginning with a slash character are part of the PDF file format. They are +included here to aid to anyone searching PyPDF documentation +for these names from the PDF specification.) From 621de5e9f90868a9f1c1a994adaac1eaeb5e6676 Mon Sep 17 00:00:00 2001 From: marcstober Date: Tue, 19 Sep 2023 11:06:10 -0400 Subject: [PATCH 2/2] Update docs/user/viewer-preferences.md Co-authored-by: Martin Thoma --- docs/user/viewer-preferences.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/viewer-preferences.md b/docs/user/viewer-preferences.md index e5bd0c0ba..01fd8ad5c 100644 --- a/docs/user/viewer-preferences.md +++ b/docs/user/viewer-preferences.md @@ -79,5 +79,5 @@ with open("output.pdf", "wb") as output_stream: ``` (The names beginning with a slash character are part of the PDF file format. They are -included here to aid to anyone searching PyPDF documentation +included here to aid to anyone searching pypdf documentation for these names from the PDF specification.)