Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docstring, bump version #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pdfrw/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .errors import PdfParseError
from .pagemerge import PageMerge

__version__ = '0.4.post2'
__version__ = '0.5.1'

# Add a tiny bit of compatibility to pyPdf

Expand Down
8 changes: 4 additions & 4 deletions pdfrw/objects/pdfstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
in literal strings is to not escape parentheses. This only works, and is
only allowed, when the parentheses are properly balanced. For example,
"((Hello))" is a valid encoding for a literal string, but "((Hello)" is not;
the latter case should be encoded "(\(Hello)"
the latter case should be encoded "(\\(Hello)"

Encoding text into strings
==========================
Expand Down Expand Up @@ -372,12 +372,12 @@ def decode_literal(self):
Possible string escapes from the spec:
(PDF 1.7 Reference, section 3.2.3, page 53)

1. \[nrtbf\()]: simple escapes
1. \\[nrtbf\\()]: simple escapes
2. \\d{1,3}: octal. Must be zero-padded to 3 digits
if followed by digit
3. \<end of line>: line continuation. We don't know the EOL
3. \\<end of line>: line continuation. We don't know the EOL
marker used in the PDF, so accept \r, \n, and \r\n.
4. Any other character following \ escape -- the backslash
4. Any other character following \\ escape -- the backslash
is swallowed.
"""
result = (self.unescape_func or self.init_unescapes())(self[1:-1])
Expand Down