opened
catsmile
username_0
Link to PDF file (or attach file here): http://s000.tinyupload.com/index.php?file_id=00088937975359643663

Configuration:
- Web browser and its version: Google Chrome 53.0.2785.143 m (the latest for now), Mozilla Firefox 49.0.1
- Operating system and its version: Windows 7 SP1 x64 
- PDF.js version: 1.6.210
- Is an extension: no

Not sure if this is a really PDF.js issue, probably it is related to the Adobe cmap files. The workaround of the issue is placed at the end if the issue description.

Steps to reproduce the problem:
1. Open the attached file in the PDF.js viewer.
2a. The viewer throw the following error in the JS console: "DOMException: Invalid font data inArrayBuffer."
2b. The file displays incorrectly (characters are different in compare with the file opened in the Adobe Acrobat).

The PDF file opened in the Adobe Acrobat: https://snag.gy/0uApct.jpg
The PDF file opened in the PDF.js viewer (malformed): https://snag.gy/eVcl21.jpg
Developer console with error: https://snag.gy/ZoWXuA.jpg

IMPORTANT NOTES (WORKAROUND)
1. The viewer tries to use the Adobe-Japan1-UCS2.bcmap cmap that is in the original PDF.js distribution. 
2. If I set the cMapPacked property to false and add the unpacked cmap file from the Adobe Acrobat distribution, the behavior is the same. The version of the cmap file is 8.001
3. I've found the older cmap file version (5.001) and generated the appropriate packed cmap with the cmapscompress tool (https://github.com/mozilla/pdf.js/tree/master/external/cmapscompress). Everything started working fine for the PDF file: https://snag.gy/GwfJVE.jpg.

Plain text cmaps:
- 8.001 (from the Adobe Acrobat distro, not working): http://s000.tinyupload.com/index.php?file_id=17713344732879219876
- 5.001 (working): http://s000.tinyupload.com/index.php?file_id=91820851318135254049

Packed cmaps:
- probably 8.001 (from the PDF.js distro, not working): http://s000.tinyupload.com/index.php?file_id=57887949807560618862
- 5.001 (self generated, working): http://s000.tinyupload.com/index.php?file_id=01658083714704364959
PDF file containing hyeroglyphical characters: cmap Adobe-Japan1-UCS2 (8.001) does not work but 5.001 do.
issue
created
yurydelendik
username_1
I compared http://s000.tinyupload.com/index.php?file_id=17713344732879219876 with file in the PDF.js they looked exactly the same. Please provide complete example(s), e.g. open new repo at github that demonstrate issue.
comment
created
catsmile
username_0
Here you go: https://github.com/username_0/pdfjs-cmap-issue
I've left just the Adobe-Japan1-UCS2 cmaps (5.001 and 8.001).
/web/viewer_correct.html will use the /cmaps/5.001/Adobe-Japan1-UCS2.bcmap
/web/viewer_malformed.html will use the /cmaps/8.001/Adobe-Japan1-UCS2.bcmap
comment
created
Snuffleupagus
username_2
I'm not convinced that the CMap *itself* is the problem here, since the only noticeable difference between the working/non-working CMap looks to be that in the latter case it's quite a bit longer.

When looking (quickly) at the resulting glyph map created by PDF.js, it seems that a fair number of `charCode`s are mapped to the same `glyphId`s. I thus suspect that this issue might have the same cause, and possibly the same solution, as described in https://github.com/mozilla/pdf.js/issues/6397#issuecomment-164954332.
comment
created
catsmile
username_0
Well, okay. As for my project I'll user the Adobe-Japan1-UCS2.bcmap of version 5.001 as a workaround.
comment
closed
Snuffleupagus
username_2
issue
created
Snuffleupagus
username_2
Closing as fixed by PR #8580.
comment
created
nguyenngochanh
username_3
Hello, 
My app is cordova, i received crash when read pdf searchable
CDVWKWebViewEngine: Error Domain=NSCocoaErrorDomain Code=260 "The file “nullAdobe-Japan1-UCS2.bcmap” couldn’t be opened because there is no such file.

Could you help me?
comment