Skip to content

Conversation

fishrdev
Copy link

This is a fix for #292 and possibly #84 (needs testing).
Both issues are related to un-escaped character sequences in literal scanning.

As stated in pdf specification:

Within a literal string, the backslash () is used as an escape character for various purposes, such as to include newline characters, nonprinting ASCII characters, unbalanced parentheses, or the backslash character itself in the string. The char-acter immediately following the backslash determines its precise interpretation (see Table 3.2). If the character following the backslash is not one of those shown in the table, the backslash is ignored.

When opening a pdf with PdfSharpCore, it should ignore the backslash if no character with special meaning follows it. This commit removes the exception and ignores the backslash for literal strings. This can also be done when the digit after a backslash is greater than 7.

As stated in pdf specification:
Within a literal string, the backslash () is used as an escape character for various purposes, such as to include newline characters, nonprinting ASCII characters, unbalanced parentheses, or the backslash character itself in the string. The char-acter immediately following the backslash determines its precise interpretation (see Table 3.2). If the character following the backslash is not one of those shown in the table, the backslash is ignored.

When opening a pdf with PdfSharpCore, it should ignore the backslash if no character with special meaning follows it. This commit removes the exception and ignores the backslash for literal strings.
This can also be done when the digit after a backslash is greater than 7.
@ststeiger ststeiger merged commit 63ab523 into ststeiger:master Sep 22, 2022
@ststeiger
Copy link
Owner

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants