-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add habibi.pdf from py-pdf/pypdf#1111 Add sample pdf with alternate CMap structure
- Loading branch information
Showing
5 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Arabic script for testing text extraction | ||
|
||
`habibi.pdf` was generated using weasyprint 54.1-3 on debian unstable in July 2022, using the following command: | ||
|
||
```bash | ||
weasyprint habibi.html habibi.pdf | ||
``` | ||
|
||
See also https://github.com/py-pdf/PyPDF2/issues/1111 | ||
|
||
# CMap Structure | ||
|
||
`habibi-oneline-cmap.pdf` is the same file, but the `beginbfchar` stanza of the `ToUnicode` CMap is written with ASCII space delimiters between `<srcString> <dstString>` pairings, rather than newlines. That is, where `habibi.pdf` contains: | ||
|
||
``` | ||
6 beginbfchar | ||
<0003> <> | ||
<03f2> <> | ||
<0392> <> | ||
<03f4> <> | ||
<02f4> <> | ||
<03a3> <062d064e0628064a0628064a0020> | ||
endbfchar | ||
``` | ||
|
||
`habibi-oneline-cmap.pdf` contains: | ||
|
||
``` | ||
6 beginbfchar | ||
<0003> <> <03f2> <> <0392> <> <03f4> <> <02f4> <> <03a3> <062d064e0628064a0628064a0020> | ||
endbfchar | ||
``` | ||
|
||
Otherwise the two files are exactly identical. | ||
|
||
I believe text extraction should behave the same way on both files. | ||
From what i understand of the PDF specification, they are syntactically equivalent. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>habibi</title> | ||
</head> | ||
<body> | ||
<div>حَبيبي habibi</div> | ||
</body> | ||
</html> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters