Tim van der Meij
90982332bf
Merge pull request #5995 from CodingFabian/tweak-char-spacing-text-selection
...
Apply char spacing only when there are chars.
2015-05-14 20:06:22 +02:00
Jonas Jenwald
0365baf5ab
Fall back to the |defaultEncoding| when no valid "post" table is found in TrueType fonts (bug 1050040)
...
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1050040 .
With this patch the file is completely readable, but given that the font is broken enough to be rejected by OTS the rendering differs slightly from Adobe Reader.
*Note:* the PDF file is sufficiently broken that even Adobe Reader complains about the font, *and* also about another more general issue.
2015-05-14 13:16:14 +02:00
Jonas Jenwald
70b839386a
Ensure that the cmap position is within the bounds of the font file in |readCmapTable|
2015-05-14 13:16:09 +02:00
Tim van der Meij
67816bd085
Merge pull request #5999 from hellemar/handle-utf8-in-url
...
Bug 1122280 - Handle UTF-8 encoding in URI
2015-05-14 12:52:40 +02:00
Fabian Lange
c2013094e7
Apply char spacing only when there are chars.
2015-05-13 23:45:20 +02:00
Tim van der Meij
d484ebd492
Merge pull request #5910 from jordan-thoms/fix-concatenated-files
...
Fix error reading concatenated pdfs
2015-05-13 22:40:55 +02:00
Tim van der Meij
b34366d2fc
Merge pull request #5898 from stri8ed/master
...
Extract more accurate glyph heights from type3 fonts
2015-05-13 21:07:17 +02:00
Yury Delendik
dd07ef9c6a
Disables rAF for the printing.
2015-05-12 08:44:42 -05:00
Martin Heller
a61a4b18cc
URL annotations handled as UTF-8 to accommodate some bad PDFs. For proper 7-bit ASCII this makes no difference. Fixes Bug 1122280.
2015-05-11 00:46:59 +02:00
Jonas Jenwald
6d2d854f65
Merge pull request #5815 from Snuffleupagus/type1-diff-refs
...
Ensure that entries in the Differences array of Type1 fonts are either numbers or names
2015-05-07 22:33:23 +02:00
Brendan Dahl
cd53cbe7d4
Merge pull request #5964 from Snuffleupagus/bug-1157493
...
Handle the Encoding being a dictionary in PartialEvaluator_preEvaluateFont (bug 1157493)
2015-05-05 14:41:32 -07:00
Tim van der Meij
0c84899c0a
Revert #5603 regarding Chrome range request bug
2015-04-30 22:37:52 +02:00
Tim van der Meij
6159da0598
Merge pull request #5828 from Rob--W/mozCurrentTransform-fix
...
Fix flaw in mozCurrentTransform polyfill
2015-04-29 19:27:02 +02:00
Jonas Jenwald
760222cf0b
Handle the Encoding being a dictionary in PartialEvaluator_preEvaluateFont (bug 1157493)
...
*This is a regression from PR 4423.*
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1157493 .
2015-04-25 16:48:14 +02:00
Jonas Jenwald
7c7d05e7a3
Attempt to infer if a CMap file actually contains just a standard Identity-H
/Identity-V
map
2015-04-25 11:28:33 +02:00
Tim van der Meij
48b2f6d023
Merge pull request #5756 from Snuffleupagus/issue-5751
...
Guess CIDFontType0 subtype based on font file contents (issue 5751)
2015-04-24 23:50:07 +02:00
Brendan Dahl
846eb967cc
Merge pull request #5655 from Snuffleupagus/issue-5644
...
Avoid getting stuck in empty nodes in the Pages tree when calling |Catalog_getPageDict| (issue 5644)
2015-04-20 11:46:27 -07:00
Jordan Thoms
d0ea772fc6
Fix error reading concatenated pdfs
2015-04-18 20:56:07 +12:00
Jonas Jenwald
4c2ad3bc7b
Ensure that entries in the Differences array of Type1 fonts are either numbers or names
...
This patch is yet another installment in the (never ending) series of bugs in PDF files with non-embedded fonts.
Fixes http://www.int.washington.edu/talks/WorkShops/int_08_37W/People/Franz_M/Franz.pdf .
2015-04-17 20:32:27 +02:00
Marco Castelluccio
1bd952f897
Use Int32Array instead of Uint32Array in FlateStream
2015-04-17 16:33:04 +02:00
Brendan Dahl
63aaf1b969
Merge pull request #5923 from Snuffleupagus/bug-911034
...
Don't map glyphs to certain problematic General Punctuation Unicode locations (bug 911034)
2015-04-15 14:31:54 -07:00
Thomas Leitner
3ebc85e55f
Crypt filter EFF key should have StmF value as default, not StrF
...
This fixes the problem.
2015-04-13 21:27:32 +02:00
Jonas Jenwald
fda858ae33
Don't map glyphs to certain problematic General Punctuation Unicode locations (bug 911034)
...
Fixes the remaining missing characters in https://bugzilla.mozilla.org/show_bug.cgi?id=911034 .
For reference, see http://www.unicode.org/charts/PDF/U2000.pdf (and also http://en.wikipedia.org/wiki/General_Punctuation_%28Unicode_block%29 ).
2015-04-09 17:27:03 +02:00
Jonas Jenwald
a54ec673c5
Move the checks for problematic Unicode locations from |adjustMapping| to a separate helper function
2015-04-09 12:56:29 +02:00
Levi Melamed
a5159a7942
extract more accurate glpyh heights from type-3 fonts
2015-04-03 08:49:06 -05:00
Andrew Dacenko
bdde3d6622
Restrict logging of errors with verbosity level
2015-03-28 21:44:41 +02:00
Jonas Jenwald
2b1a13ba28
Don't map glyphs to Unicode position 0x0E33, i.e. Thai character SARA AM (bug1046314)
...
*A similar approach as in PR 5705.*
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1046314 .
According to https://dxr.mozilla.org/mozilla-central/source/gfx/harfbuzz/src/hb-ot-shape-complex-thai.cc#270-365 , `0x0E33` is treated as a special case (by the font shaping code in Firefox). Hence it seems reasonable to skip it when adjusting the font mapping.
2015-03-26 13:22:45 +01:00
Brendan Dahl
3a8d4a7d72
Merge pull request #5713 from Snuffleupagus/evaluator-IdentityToUnicodeMap
...
Create a IdentityToUnicodeMap in evaluator.js when toUnicode contains IdentityH/IdentityV
2015-03-25 10:33:29 -07:00
Brendan Dahl
519b6669f0
Merge pull request #5705 from Snuffleupagus/bug-1108301
...
Don't map glyphs to Unicode "Dotted circle" combining mark (bug 1108301)
2015-03-24 16:33:04 -07:00
Jonas Jenwald
d762cad420
Fix the node getinfo.js example
...
This broke in PR 5366.
2015-03-17 14:26:58 +01:00
Jonas Jenwald
f7b3852dd5
Merge pull request #5843 from timvandermeij/svg-commands
...
Enable OPS.setHScale in the SVG backend
2015-03-16 12:50:07 +01:00
Tim van der Meij
989eac2f1e
Enable OPS.setHScale in the SVG backend
2015-03-16 00:37:31 +01:00
Jonas Jenwald
e894a0a4c6
Guess CIDFontType0 subtype based on font file contents (issue 5751)
2015-03-15 13:35:48 +01:00
Jonas Jenwald
65a5543efe
Disable PresentationMode for certain problematic configurations
...
Instead of trying to hack around various browser defects, let's just disable PresentationMode in the affected browsers. This patch:
- Disables PresentationMode in IE11+ when the viewer is embedded; fixes 4711.
2015-03-13 22:09:36 +01:00
Rob Wu
6eb9e6a6a4
Fix flaw in mozCurrentTransform polyfill
...
Set transformation matrix in (polyfilled) mozPrintCallback when a scale
is applied. Removed _scaleX and _scaleY in favor of _transformMatrix to
emphasize that the caller MUST ensure that the state of the matrix is
correct before `addContextCurrentTransform` is called.
2015-03-11 20:55:26 +01:00
Jonas Jenwald
4a9ff471c4
Correctly detect the presence of the Adobe specific APP14 JPEG marker (bug 1140761)
...
According to the specification, http://partners.adobe.com/public/developer/en/ps/sdk/5116.DCT_Filter.pdf#G3.851943 , the content of the marker segment should begin with `Adobe`, and not `Adobe\x00` as the code currently look for.
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1140761 .
Fixes the colour conversion part of issues 4090 and 5623.
2015-03-10 13:07:09 +01:00
Tim van der Meij
c69ad5885c
Merge pull request #5770 from Snuffleupagus/opentype-cff
...
Correctly detect OpenType font files with CFF data
2015-03-06 22:58:43 +01:00
Tim van der Meij
5eedfff647
Merge pull request #5734 from Hengjie/lower-space-threshold
...
Lower space factor threshold
2015-03-06 21:00:01 +01:00
Tim van der Meij
026b57641f
Remove unused isNull utility function
2015-02-28 18:50:58 +01:00
Jonas Jenwald
f81fc9091a
Correctly detect OpenType font files with CFF data
...
Fixes 5334.
Fixes 215.
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1125614 .
According to the specification, http://www.microsoft.com/typography/otspec/otff.htm , OpenType font files with CFF data should have `OTTO` in the header.
2015-02-28 13:43:53 +01:00
Jonas Jenwald
00ee6bd6b6
Merge pull request #5693 from collinanderson/whitespace
...
cleaned whitespace
2015-02-28 10:09:21 +01:00
Yury Delendik
4c2640dcf0
Merge pull request #5758 from mjlyons/ext-link-new-window
...
Add option to open external links in new window
2015-02-27 10:49:39 -06:00
Yury Delendik
2e14cc70cc
Merge pull request #5731 from Snuffleupagus/issue-5331
...
Skip fill bytes (0xFF) when decoding JPEG images (issue 5331)
2015-02-27 06:36:30 -06:00
Yury Delendik
23916b2b14
Merge pull request #5748 from Snuffleupagus/issue-5747
...
Fetch parameters if they are a |Ref| in CalGray/CalRGB color spaces (issue 5747)
2015-02-26 17:44:46 -06:00
Jonas Jenwald
0a3341dadc
Don't map glyphs to Unicode "Dotted circle" combining mark (bug 1108301)
...
It seems that `0x25CC` is another bad spot for charCodes.
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1108301 .
2015-02-27 00:20:38 +01:00
Mike Lyons
d271811740
Add option to open external links in new window
2015-02-26 13:34:08 -05:00
Jonas Jenwald
888cbe0bde
Avoid getting stuck in empty nodes in the Pages tree when calling |Catalog_getPageDict| (issue 5644)
2015-02-22 17:42:15 +01:00
Jonas Jenwald
7c8996558a
Fetch parameters if they are a |Ref| in CalGray/CalRGB color spaces (issue 5747)
2015-02-20 12:53:02 +01:00
Jonas Jenwald
417800a1b5
Only skip the |!isSymbolicFont| check for TrueType (3, 1) cmap tables if no previous cmap table was found (PR 5703 followup)
...
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=894572 .
2015-02-19 13:58:03 +01:00
Brendan Dahl
6bb0a483b1
Merge pull request #5703 from Snuffleupagus/issue-5701
...
Relax the |isSymbolicFont| check for TrueType (3, 1) cmap tables (issue 5701)
2015-02-18 14:50:19 -08:00
Collin Anderson
54e984c763
cleaned whitespace
2015-02-17 11:07:37 -05:00
Hengjie
109d67691c
Lower threshold
...
Fixes text selection formatting with https://github.com/vortext/vortext/blob/master/resources/public/examples/TestDocument3.pdf
2015-02-13 22:27:49 -08:00
Jonas Jenwald
3651c9e1f7
Skip fill bytes (0xFF) when decoding JPEG images (issue 5331)
2015-02-14 00:08:43 +01:00
Tim van der Meij
27e3558a41
Fix CCITTStream regression by byte-aligning rows before checking EOL marker
2015-02-13 21:29:00 +01:00
Jonas Jenwald
592890a758
Relax the |isSymbolicFont| check for TrueType (3, 1) cmap tables (issue 5701)
2015-02-13 01:03:10 +01:00
Brendan Dahl
394b38b22f
Merge pull request #5651 from Snuffleupagus/missing-glyphs
...
Try to skip mapping of missing TrueType and CIDFontType2 glyphs
2015-02-11 19:31:22 -08:00
Brendan Dahl
fb8200096b
Merge pull request #5634 from Snuffleupagus/cmap-0,0
...
Add support for TrueType (0, 0) cmap tables (issue 5501, issue 5574, and bug 1037973)
2015-02-11 15:04:03 -08:00
Jonas Jenwald
f19a1db414
Create a IdentityToUnicodeMap in evaluator.js when toUnicode contains IdentityH/IdentityV
...
Currently if a font contains a `toUnicode` entry, we always create a new `ToUnicodeMap` in evaluator.js. This is done even for `IdentityV/IdentityH`, despite to possibility to use the much more compact `IdentityToUnicodeMap` representation.
This patch refactors the `IdentityH/IdentityV` cases, to:
- Avoid calling `IdentityCMap.getMap`, since this prevents allocating and iterating through an array with 65536 elements.
- Ensure that the handling of `toUnicode` is actually correct in fonts.js.
We rely on `toUnicode instanceof IdentityToUnicodeMap` in a few places, and currently this does not work correctly for `IdentityH/IdentityV`.
2015-02-09 16:52:31 +01:00
Jonas Jenwald
01e6565dd4
Try to skip mapping of missing TrueType glyphs
...
Also don't skip mapping of glyphs which are empty, if the corresponding charCode is included in toUnicode.
2015-02-07 12:19:38 +01:00
Jonas Jenwald
8174da61fb
Don't skip mapping of glyphs for CIDFontType2 fonts with a CIDToGIDMap
...
Also don't skip mapping of glyphs which are empty, if the corresponding charCode is included in toUnicode.
2015-02-07 12:19:37 +01:00
Brendan Dahl
cb27707277
Try to skip mapping of missing glyphs.
2015-02-07 12:19:37 +01:00
Jonas Jenwald
bb16475070
Use the |shadow| function from src/shared/util.js in viewer.js
2015-01-31 22:43:30 +01:00
Tim van der Meij
06004d6a92
Make sure that an A entry in an annotation dictionary is also a dictionary itself
2015-01-29 13:21:18 +01:00
fkaelberer
8013100ab8
avoid out of range array access in JBIG2 decoder
2015-01-23 23:50:09 +01:00
Tim van der Meij
465f52e7ce
Merge pull request #5567 from CodingFabian/fixup-5439
...
Add marker segment (PLT, PLM) and refactor TLM
2015-01-15 00:37:23 +01:00
Jonas Jenwald
daba13aebb
Amend the docs for |disableAutoFetch| to mention that streaming must also be disabled
2015-01-14 18:33:12 +01:00
Jonas Jenwald
c2c54257f2
Prevent setting |isStandardFont| to |undefined| for non-embedded fonts
...
This is a very small follow-up to PR 5536, which sets `isStandardFont` to `false` instead of `undefined` (as currently happens for some font names).
Since the patch is so small, I hope it's OK to also fix an unrelated copy-and-paste error in a comment that was added in PR 5260.
2015-01-13 15:44:34 +01:00
Tim van der Meij
95fcbc2325
Merge pull request #5624 from yurydelendik/base64
...
Base64 example and be more flexible what type of data is passed
2015-01-12 23:06:06 +01:00
Yury Delendik
81649b00a9
Base64 example and be more flexible what type of data is passed.
2015-01-12 14:52:52 -06:00
Emanuel Arguinarena
3d01c345a1
Add marker segment (PLT, PLM) and refactor TLM
2015-01-11 22:54:50 +01:00
Jonas Jenwald
ad41a2d574
Add support for TrueType (0, 0) cmap tables (issue 5501 and 5574)
2015-01-11 14:54:12 +01:00
Jonas Jenwald
eac168f3cc
Refactor searching for end of inline (EI) JPEG image streams
...
This patch changes searching for EI image streams to rely on the EOI (end-of-image) marker for DCTDecode filters (i.e. JPEG images).
2015-01-10 23:55:55 +01:00
Jonas Jenwald
6dfc73a5da
Modify |getUint16| to correctly handle missing data in Stream, DecodeStream and ChunkedStream
2015-01-10 23:55:54 +01:00
Jonas Jenwald
35e668079d
Merge pull request #5627 from yurydelendik/tel
...
Whitelists 'tel' schema.
2015-01-10 18:21:36 +01:00
Brendan Dahl
6ceb652abb
Merge pull request #5554 from yurydelendik/apiref
...
Refactors getDocument and adds PDFDataRangeTransport.
2015-01-08 14:24:38 -08:00
Yury Delendik
982accf1d7
Whitelists 'tel' schema.
2015-01-08 09:10:42 -06:00
Yury Delendik
34bed638bb
Merge pull request #5600 from timvandermeij/str-undefined
...
Implement guards for stringToBytes and bytesToString
2015-01-06 16:27:17 -06:00
Yury Delendik
e0f6071178
Merge pull request #5603 from Rob--W/xhr-range-206-bugfix
...
Use Content-Range instead of Content-Length #5512
2015-01-06 07:40:38 -06:00
Rob Wu
c02b2cb37c
Use Content-Range instead of Content-Length #5512
...
Use Content-Range header instead of Content-Length when the
response has status code 206, to work around issue #5512 ,
which is caused by a bug in Chrome (since version 39):
https://code.google.com/p/chromium/issues/detail?id=442318
2015-01-06 14:26:41 +01:00
Yury Delendik
3a61edfcae
Refactors getDocument and adds PDFDataRangeTransport.
2015-01-05 21:45:01 -06:00
Tim van der Meij
6e99c29cf8
Implement guards for stringToBytes and bytesToString
2015-01-02 23:35:51 +01:00
Jonas Jenwald
1fea44ce14
Ensure that |get fingerprint| doesn't fail if the ID is not an array (issue 5599)
...
According to the [PDF specification](http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#page=51 ) the `ID` should be an array. To prevent errors if the PDF file violates that part of the spec, check that the `ID` is actually an array.
Fixes 5599.
2014-12-30 16:16:43 +01:00
Tim van der Meij
b835ef425e
CCITTFaxStream: fix regression when EncodedByteAlign is true and EndOfLine is false
2014-12-30 00:07:35 +01:00
Jonas Jenwald
50fe7c8d0a
Merge pull request #5571 from timvandermeij/annotation-rewrite-2
...
Remove unused hasOperatorList code
2014-12-27 12:14:08 +01:00
Jonas Jenwald
406b57fae4
Merge pull request #5569 from timvandermeij/annotation-rewrite-1
...
Remove unused annotation highlight div
2014-12-23 11:17:20 +01:00
Yury Delendik
72bb48b92e
Merge pull request #5566 from MaMazav/Bug_fix_Empty_packet_advance_iterator
...
Fixed empty packet parsing bug
2014-12-22 08:15:41 -06:00
Yury Delendik
96647877ec
Merge pull request #4615 from Snuffleupagus/canvas-enforce-min-line-width
...
Enforce minimum line widths
2014-12-21 22:12:45 -06:00
Tim van der Meij
91aa3925ee
Remove unused hasOperatorList code
2014-12-21 19:33:14 +01:00
Tim van der Meij
c67ad28673
Remove unused annotation highlight div
...
This is now done using CSS. For annotation-heavy documents this change makes the DOM much lighter.
2014-12-21 17:38:22 +01:00
Tim van der Meij
6e994b15e2
Merge pull request #5214 from CodingFabian/optimize-annotation-layer
...
Improves rendering performance of annotation layers.
2014-12-21 16:50:36 +01:00
Fabian Lange
979635138a
Improves rendering performance of annotation layers.
...
This change does the following:
* Address TODO to remove getEmptyContainer helper.
* Not set container bg-color. The old code is incorrect, causing it to
not have any effect. It sets color to an array (item.color) rather
css string. Also in most cases it would set it to black background
which is incorrect.
* only add border instructions when there is actually a border
* reduce memory consumption by not creating new 3 element arrays for
annotation colors. In fact according to spec, this would be incorrect,
as the default should be "transparent" for an empty array. Adobe
Reader interprets a missing color array as black however.
Note that only Link annotations were actually setting a border style and
color. While Text annotations might have calculated a border they did
not color it. This behaviour is now controlled by the boolean flag.
2014-12-20 22:49:58 +01:00
MaMazav
3d8b71175c
Fixed empty packet parsing bug
...
Packet iterator was not advanced for empty packets.
2014-12-20 22:31:28 +02:00
Jonas Jenwald
fc1e2483b4
Enforce minimum line widths
2014-12-20 18:05:55 +01:00
Jonas Jenwald
d8b905048b
Add fallback for non-embedded "Century Gothic" CIDFontType2 font (issue 4722 and bug 879561)
...
According to practical experiments, falling back to "Helvetica" when we encounter a non-embedded "[Century Gothic](http://en.wikipedia.org/wiki/Century_Gothic )" `CIDFontType2` font seems to work well.
(Also, the section on Wikipedia about "Printer ink usage" *might* provide some anecdotal evidence that Century Gothic is a fairly standard sans-serif font.)
Obviously this patch doesn't make "Century Gothic" fonts render perfectly, as is often the case with non-embedded fonts, but all the text is now legible in the referenced issues.
Fixes 4722.
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=879561 .
2014-12-18 23:19:34 +01:00
Yury Delendik
a018e933ea
Merge pull request #5446 from CodingFabian/minorImprovementsInCanvasjs
...
minor improvements and code cleanup for canvas.js
2014-12-18 15:05:52 -06:00
Fabian Lange
5405b1c8e4
minor improvements and code cleanup for canvas.js
2014-12-18 21:59:40 +01:00
Yury Delendik
31ae5f2a3d
Merge pull request #5379 from brendandahl/nbsp
...
Don't map glyphs to unicode non breaking space.
2014-12-18 13:38:03 -06:00
Yury Delendik
0c3a8ba657
Merge pull request #5463 from Snuffleupagus/wingdings
...
Add basic support for non-embedded Wingdings fonts
2014-12-18 11:29:37 -06:00
Yury Delendik
c918cc5fa6
Merge pull request #5494 from MaMazav/Issue5418_Progression_Orders
...
Support all progression orders
2014-12-18 10:21:35 -06:00
Yury Delendik
f4fa7aaf19
Merge pull request #5383 from Snuffleupagus/bug-1077808
...
Fix searching for end of inline (EI) images with ASCII85Decode filters (bug 1077808)
2014-12-18 10:03:27 -06:00
Tim van der Meij
ee70aadb56
Merge pull request #5549 from MaMazav/Support_EPH_and_SOP_markers
...
Support EPH and SOP markers.
2014-12-17 22:23:36 +01:00
MaMazav
c7acbfd901
Support EPH and SOP markers.
2014-12-17 12:55:52 +02:00
MaMazav
48ee94e8ed
Added support for all not supported yet progression orders: RPCL, CPRL and PCRL.
2014-12-16 21:45:51 +02:00
Yury Delendik
ee1b1252ff
Merge pull request #5124 from jordan-thoms/improve-fingerprinting
...
Improve fingerprinting of documents
2014-12-15 13:30:14 -06:00
Jonas Jenwald
184880a751
Fix searching for end of inline (EI) images with ASCII85Decode filters (bug 1077808)
...
This patch changes searching for the end of inline image streams to rely on the EOD marker for the filters: ASCII85Decode and ASCIIHexDecode.
2014-12-15 18:48:29 +01:00
Yury Delendik
f5df30f967
Merge pull request #5445 from CodingFabian/fixImageCachingInParser
...
Fixes caching of inline images during parsing.
2014-12-15 10:51:23 -06:00
Yury Delendik
bc27774cfd
Merge pull request #5508 from Snuffleupagus/jpeg-stream-find-soi
...
Refactor searching for the SOI marker of inline JPEG image streams
2014-12-15 09:36:24 -06:00
Jordan Thoms
aa53319c87
Improve fingerprinting of documents
...
Fixes two issues:
- #4456 : The first 100 bytes are often not unique as they can be
filled with standard PDF headers - so we use the first 200 KB instead.
(This may be overkill)
- Some documents we encountered have invalid xref ids, which were
always coming out as ‘0000000000000000’ - so we detect that and use the
MD5 instead.
2014-12-11 12:55:05 +13:00
Jonas Jenwald
96a77e9d6a
Add basic support for non-embedded Wingdings fonts
...
This is a tentative patch that adds *very* basic support for non-embedded Wingdings fonts (a Windows version of Dingbats), by falling back to the ZapfDingbats encoding. Obviously this approach will not work perfectly, but in my opinion it seems to work reasonably well in pratice.
Instead of this very simple patch, another option would be to try and include more complete glyph data for Wingdings, e.g. a Unicode map and glyph widths, similar to what was done for ZapfDingbats.
However there is, in my opinion, one important difference between Wingdings and ZapfDingbats: ZapfDingbats is part of the 14 standard fonts, which in previous versions of the PDF specification was assumed to be available in PDF readers. To improve compatibility with older files, it thus makes sense for us to include data for ZapfDingbats.
However Wingdings has never been a standard font in PDF files, hence PDF files using it *should* thus contain all the necessary font data.
Given the above, I thus believe that it should be OK to fall back to ZapfDingbats for now. If non-embedded Wingdings fonts turns out to be *a lot* more common, then we can revisit this later.
Fixes 4301 completely.
Fixes 4837 almost completely. With this patch the bullets are displayed correctly, but the arrows are not of the correct type.
Fixes `artofwar.pdf`, pages 14 and 15.
2014-12-09 00:28:22 +01:00
Yury Delendik
35474628e3
Merge pull request #5449 from CodingFabian/preferParamsOverArguments
...
Use 3 param method for converting r,g,b into css string.
2014-12-08 15:23:12 -06:00
Yury Delendik
7f24b1d602
Merge pull request #5448 from thejdeep/androidfix
...
Added try/catch #5427
2014-12-08 14:56:27 -06:00
Fabian Lange
ceffeab1de
Use 3 param method for converting r,g,b into css string.
...
This avoids creation of temporary arrays to pass them into the util
method. Also using "arguments" is more expensive then passing in 3
parameters.
2014-12-05 19:25:02 +01:00
Yury Delendik
a3df129e32
Merge pull request #5524 from fkaelberer/increaseSMaskChunkSizeTo1M
...
Increases chunk size in SMask composition to 1M pixels
2014-12-05 08:42:06 -08:00
Yury Delendik
cddb870856
Merge pull request #5523 from CodingFabian/remove-canvas-rounding-luminosity
...
removed rounding of values in composeSMaskLuminosity
2014-12-05 08:40:38 -08:00
Yury Delendik
8a6cc44144
Merge pull request #5507 from palkan/fix-promise-null
...
Fix passing null as onFullfilled (which is broken in Chrome(-ium) 32)
2014-12-05 08:36:46 -08:00
Jonas Jenwald
3e1b5216ac
Refactor searching for the SOI marker of inline JPEG image streams
2014-12-05 17:24:27 +01:00
fkaelberer
7d698a46a9
increase chunk size in SMask composition to 1M pixels
2014-12-03 10:25:53 +01:00
Fabian Lange
b049119d14
removed rounding of values in composeSMaskLuminosity
...
maskData comes out of maskCtx.getImageData, so is 0..255 clamped, and
the used multiplications will not create fractions needing rounding,
neither would addition.
2014-12-02 22:25:54 +01:00
Jonas Jenwald
78d0d269dc
Fallback to the |Dummy| Pattern when we fail to parse a Shading Pattern (issue 5509)
2014-11-30 21:21:45 +01:00
palkan
4764c52b5b
fix passing null as Promise's onFullfilled (which is broken in Chrome 32)
2014-11-25 16:40:27 +04:00
jsundn
2ec7e34541
Fixes typo in webgl.js
2014-11-18 14:31:19 +01:00
Paul Roit
da5c0cf0e2
fixed multi precinct handling in jpx
...
fixes #5475
2014-11-13 09:07:18 +01:00
fkaelberer
5fcf3d37a7
use fewer multiplications in convertYcckToRgb
2014-11-05 15:53:10 +01:00
fkaelberer
ea719ae805
remove null checks that always evaluate to false
2014-11-05 15:19:30 +01:00
Jonas Jenwald
1abad5f290
Fix typed array assignment in the |constructPostScriptFromIRResult| function (issue 5470)
2014-11-04 12:17:27 +01:00
Fabian Lange
970c048d50
fixes caching of inline images during parsing.
...
As described in #5444 , the evaluator will perform identity checking of
paintImageMaskXObjects to decide if it can use
paintImageMaskXObjectRepeat instead of paintImageMaskXObjectGroup.
This can only ever work if the entry is a cache hit. However the
previous caching implementation was doing a lazy caching, which would
only consider a image cache worthy if it is repeated.
Only then the repeated instance would be cached.
As a result of this the sequence of identical images A1 A2 A3 A4 would
be seen as A1 A2 A2 A2 by the evaluator, which prevents using the
"repeat" optimization. Also only the last encountered image is cached,
so A1 B1 A2 B2, would stay A1 B1 A2 B2.
The new implementation drops the "lazy" init of the cache. The threshold
for enabling an image to be cached is rather small, so the potential waste
in storage and adler32 calculation is rather low. It also caches any
eligible image by its adler32.
The two example from above would now be A1 A1 A1 A1 and A1 B1 A1 B1
which not only saves temporary storage, but also prevents computing
identical masks over and over again (which is the main performance impact
of #2618 )
2014-10-28 15:39:41 +01:00
thejdeep
46238c30cf
Fix of pdf not loading on android (issue 5427)
...
Fix for pdf on android not visible
Fix for pdf on android not visible
2014-10-28 00:21:14 +05:30
Yury Delendik
1bf72f3fe8
Merge pull request #5409 from thejdeep/master
...
Black text not visible #5291
2014-10-25 09:21:08 -05:00
thejdeep
39a29cfe03
Fixed text not visible
2014-10-25 07:18:31 +05:30
fkaelberer
141ecfa61f
fix "JPX Out of Packets" Error (issues 4358, 4659, 4814)
2014-10-22 09:53:10 +02:00
Yury Delendik
8bfc4b84cb
Merge pull request #5350 from CodingFabian/issue-5349
...
For JPX decoding only read next packet after checking for byte aligning.
2014-10-21 18:05:32 -05:00
Fabian Lange
b2d7c285c0
For JPX decoding only read next packet after checking for byte aligning.
...
This patch makes the image from #5349 appear correctly, the artefacts
for the last packet are fixed in #5426 .
This patch also optimizes some "in-checks" and adds a few header parsings.
2014-10-21 22:06:10 +02:00
Yury Delendik
419ba54e58
Merge pull request #5418 from Rob--W/issue-5417-annot-error
...
Fix error in WidgetAnnotation
2014-10-21 14:27:39 -05:00
fkaelberer
e5477c3156
Simplify nextMissingChunk(), getEndChunk()
2014-10-21 10:24:32 +02:00
Jonas Jenwald
4ac4d49158
Avoid rendering invisible Type3 fonts (issue 5421)
2014-10-18 22:29:21 +02:00
Rob Wu
c889e4e679
Fix error in WidgetAnnotation
2014-10-16 18:08:24 +02:00
Yury Delendik
2d7a34d692
Fixes decoding for CMYK jpegs.
2014-10-15 15:56:29 -05:00
Brendan Dahl
ccd7ae33e4
Merge pull request #5352 from Snuffleupagus/issue-2840
...
Use |toUnicode| when creating the glyph map for standard CIDFontType2 fonts without embedded font file
2014-10-08 10:09:10 -07:00
Tim van der Meij
aaa1f2cb11
Implemented NameTree.get() using binary search
2014-10-07 00:02:15 +02:00
Tim van der Meij
b215af30d3
Require destinations when they are needed and do not fetch all of them in advance
2014-10-06 22:26:18 +02:00
Brendan Dahl
8a536ac346
Map missing glyphs in encoding to notdef glyph.
2014-10-03 12:11:20 -07:00
Brendan Dahl
2fc5e6a9ad
Don't map glyphs to unicode non breaking space.
2014-10-02 10:58:56 -07:00
Yury Delendik
fb6d87c77b
Merge pull request #5376 from yurydelendik/fontface3
...
Adds optional argument to FontFace contructor call.
2014-10-01 18:50:30 -05:00
Yury Delendik
8bec7ea8bd
Adds optional argument to FontFace contructor call.
2014-10-01 18:15:23 -05:00
Jonas Jenwald
cb3e5903cb
Fix disableAutoFetch regression in the generic viewer
...
After PR 5263, setting `disableAutoFetch = true` in the generic viewer no longer works correctly, since the entire file loads even with `disableStream = true`.
2014-10-01 20:53:17 +02:00
Rob Wu
d0845df971
Use Font Loading API if available
...
http://dev.w3.org/csswg/css-font-loading/
2014-09-30 22:18:53 +02:00
Rob Wu
6a230af332
Rename FontFace to FontFaceObject
...
This name clashes with the FontFace constructor from the Font Loading CSS module:
http://dev.w3.org/csswg/css-font-loading/#font-face-constructor
2014-09-30 19:33:16 +02:00
Jonas Jenwald
df2a4afd36
Use |toUnicode| when creating the glyph map for standard CIDFontType2 fonts without embedded font file
2014-09-27 13:20:04 +02:00
Yury Delendik
744c8e8d7e
Merge pull request #5250 from Snuffleupagus/issue-5238
...
Fix Symbol fonts without font file but with Encoding dictionary (issue 5238)
2014-09-26 15:18:33 -05:00
Brendan Dahl
9c56c6f9f6
Merge pull request #5263 from yurydelendik/stream
...
Implement streaming using moz-chunk-arraybuffer
2014-09-25 16:40:28 -07:00
Yury Delendik
07a2539867
Replaces (chunk in this.loadedChunks)
2014-09-19 19:05:25 -05:00
Yury Delendik
c3f191a27c
Implement streaming using moz-chunk-arraybuffer
2014-09-19 19:05:25 -05:00
Jonas Jenwald
3c759e296a
Add support for MMType1 fonts with embedded font files
2014-09-18 16:10:46 +02:00
Jonas Jenwald
b16c973d9d
Fix Symbol fonts without font file but with Encoding dictionary (issue 5238)
2014-09-16 21:38:53 +02:00
Yury Delendik
15681adbb9
Merge pull request #5245 from Snuffleupagus/issue-5244
...
Further amend GlyphMapForStandardFonts (issue 5244)
2014-09-16 10:12:07 -05:00
Yury Delendik
ffb613bbac
Merge pull request #5275 from Snuffleupagus/exception-propagation
...
Fix the exception propagation when rejecting workerReadyCapability
2014-09-16 10:05:34 -05:00
Brendan Dahl
403b7df6e7
Merge pull request #5233 from Snuffleupagus/bug-1057544
...
Workaround for TrueType fonts with exotic cmap tables (bug 1057544)
2014-09-15 14:47:31 -07:00
Jonas Jenwald
ed5fc43510
Add |UnexpectedResponseException| to fix the exception handling when file loading fails because the server responds with a non 404 status message
2014-09-14 11:52:33 +02:00
Jonas Jenwald
2003d83ea6
Fix loading of inline JPEG images
2014-09-11 16:42:51 +02:00
Jonas Jenwald
d1974eae34
Add peekByte method to Stream, DecodeStream and ChunkedStream
2014-09-11 16:42:41 +02:00
sangm
d716fe438a
Fixed typo in core/jpx.js #5227
2014-09-10 22:26:20 -05:00
Jonas Jenwald
7c044bc30d
Fetch decodeParams if it's a |Ref| in JBIG2Decode streams
2014-09-09 21:49:35 +02:00
Yury Delendik
aa8d3d98f8
Fetches params in makeFilter
2014-09-09 08:29:31 -05:00
Jonas Jenwald
2701edc7c6
Change getDocumentError
in web/viewer.js to use instanceof
instead of the exception name
2014-09-08 22:34:25 +02:00
Jonas Jenwald
ca027ebfdb
Fix the exception propagation when rejecting workerReadyCapability
...
Currently when an exception is thrown, we try to reject `workerReadyCapability` with multiple arguments in src/core/api.js. This obviously doesn't work, hence this patch changes that to instead reject with the exception object as is.
In src/core/worker.js the exception is currently (unncessarily) wrapped in an object, so this patch also simplifies that to directly send the exception object instead.
2014-09-08 22:20:41 +02:00
Jonas Jenwald
007d7b2d95
Fix handling of RGBA buffers in CalRGB colorspace (issue 5270)
2014-09-08 12:26:32 +02:00
Jonas Jenwald
7b3f222787
Add |SpecialPUASymbols| map and refactor |mapSpecialUnicodeValues|
2014-09-04 13:41:15 +02:00
Jonas Jenwald
2d5596172c
Add more cases to |mapSpecialUnicodeValues| to fix the rendering of various Symbol encoded brackets
2014-09-04 12:40:15 +02:00
Yury Delendik
467b3247b3
Merge pull request #5249 from Rob--W/issue-5243
...
CCITTFaxStream parser: resolve xref if needed
2014-09-03 17:38:13 -05:00
Jonas Jenwald
4bda6ba1b8
Add basic support for ZapfDingbats
2014-09-03 21:54:04 +02:00
Jonas Jenwald
be595d0721
Further amend GlyphMapForStandardFonts (issue 5244)
2014-09-01 10:51:22 +02:00
Rob Wu
07a4837763
CCITTFaxStream parser: resolve xref if needed
...
Fixes #5243
2014-08-31 11:03:24 +02:00
Jonas Jenwald
64d95bedaa
In src/display/api.js, add documentation for the |progressCallback| parameter in |PDFJS.getDocument|
2014-08-28 14:11:14 +02:00
Jonas Jenwald
cc8710acbf
Workaround for TrueType fonts with exotic cmap tables (bug 1057544)
2014-08-23 11:27:41 +02:00
Jonas Jenwald
ae896fc071
Avoid creating intermediate strings in sanitizeMetrics
...
This patch avoids creating many intermediate strings, when adding dummy width/lsb entries for glyphs where those are missing.
For the relevant PDF files in our test suite, the average number of intermediate strings are well over 1000.
2014-08-20 23:55:57 +02:00
Yury Delendik
6969ed4760
Merge pull request #5204 from nnethercote/needsDecode
...
Apply the GRAYSCALE_1BPP optimization when `needsDecode` is set.
2014-08-19 07:24:49 -05:00
Jonas Jenwald
0dbac150d5
Merge pull request #5212 from fkaelberer/fixFunctionName
...
Fix ensureByte() function name (copy-and-paste error)
2014-08-19 12:22:47 +02:00
fkaelberer
a7bbc12a81
Fix ensureByte() function name (copy-and-paste error)
2014-08-19 12:19:22 +02:00
Nicholas Nethercote
48de7651ce
Apply the GRAYSCALE_1BPP optimization when needsDecode
is set.
...
The scanned, black-and-white document at
https://bugzilla.mozilla.org/show_bug.cgi?id=835380 doesn't benefit from
the critical GRAYSCALE_1BPP optimization because the optimization is
skipped if `needsDecode` is set.
This change addresses that, and reduces both rendering time and memory
usage for that document by almost 10x.
2014-08-18 16:45:19 -07:00
Yury Delendik
be998261cc
Fixes Type3 negative font direction
2014-08-18 17:57:52 -05:00
Nicholas Nethercote
96b9af68dd
Remove setGStateForKey() closure.
...
setGStateForKey() is a closure that serves no particularly useful
purpose. This change inlines it at the single call site. This avoids 1.7
MiB of allocations (because closures are objects) for the MTA map
mentioned in https://bugzilla.mozilla.org/show_bug.cgi?id=835380#c17 .
2014-08-17 22:21:45 -07:00
Kalervo Kujala
0c5525dc8a
CalRGB: optimize CalRGB calculations
...
Also fix one silly mistake.
2014-08-16 11:38:15 +03:00
Yury Delendik
90d79d1577
Merge pull request #5198 from timvandermeij/svg-paintformxobject
...
Implements paintFormXObject in svg.js
2014-08-15 16:29:30 -05:00
Tim van der Meij
32853c07f4
Implements paintFormXObject in svg.js
2014-08-15 23:23:04 +02:00
Yury Delendik
e53a28c996
Merge pull request #5192 from nnethercote/empty-setGState
...
Ignore setGState no-ops.
2014-08-15 10:20:14 -05:00
Yury Delendik
fa8d385818
Merge pull request #5165 from kkujala/calrgb
...
implement CalRGB color space
2014-08-15 10:19:49 -05:00
Yury Delendik
5eb6a353d9
Merge pull request #5181 from timvandermeij/svg-optimizations
...
Optimizes defaults for svg.js
2014-08-15 09:40:41 -05:00
Yury Delendik
9b3c96d5d3
Merge pull request #5186 from Snuffleupagus/fix-CMap-unavailable-error-handling
...
Fix the error handling for CMaps that fail to load
2014-08-15 08:31:33 -05:00
Yury Delendik
992e7613c1
Merge pull request #5187 from nnethercote/EI-checking
...
Reduce ASCII checks in makeInlineImage().
2014-08-15 08:29:03 -05:00
Jonas Jenwald
9b480d70eb
Merge pull request #5168 from nnethercote/EvaluatorPreprocessor_read
...
Avoid unnecessary array allocations in EvaluatorPreprocessor_read().
2014-08-15 13:35:05 +02:00
Jonas Jenwald
9d87cbc516
Merge pull request #5191 from nnethercote/getSampleArray-array-length
...
Right-size the array in getSampleArray().
2014-08-15 11:36:35 +02:00
Nicholas Nethercote
9674abc542
Ignore setGState no-ops.
...
For the document in #2504 , 11% of the ops are `setGState` with a
`gStateObj` that is an empty array, which is a no-op. This is possible
because we ignore various setGState keys (OP, OPM, BG, etc).
This change prevents these ops from being inserted into the operator
list.
2014-08-14 20:46:28 -07:00
Nicholas Nethercote
bcc31b666f
Right-size the array in getSampleArray().
...
This allows the JS engine to do a better job of allocating the right
number of elements for the array, avoiding some resizings. For the PDF
in #2504 , this avoids 100s of MiBs of allocations in Firefox.
2014-08-14 18:56:12 -07:00
Nicholas Nethercote
ffae848f4e
Reduce ASCII checks in makeInlineImage().
...
makeInlineImage() has a "are the next five chars ASCII?" check which is
run after an "EI" sequence has been found. This check involves the
creation of a new object because peekBytes() calls subarray().
Unfortunately, the check is currently run on whitespace chars even when
an "EI" sequence has not yet been found, i.e. when it's not needed. For
the PDF in #2618 , there are over 820,000 such checks.
This change reworks the relevant loop so that the check is only done
once an "EI" sequence has been seen. This reduces the number of checks
to 157,000, and speeds up rendering by somewhere between 2% and 7% (the
measurements are noisy).
2014-08-14 16:20:58 -07:00
Jonas Jenwald
cd5bd9fb7e
Merge pull request #5184 from yurydelendik/cff-width
...
Use cff glyph width in the hmtx table
2014-08-14 23:40:12 +02:00
Tim van der Meij
1d02ace81f
Optimizes defaults for svg.js
2014-08-14 23:14:55 +02:00
Yury Delendik
a2c2f81167
Use cff glyph width in the hmtx table
2014-08-14 16:11:09 -05:00
Kalervo Kujala
1e4a7f981e
implement CalRGB color space
...
Both whitespace and blackspace support are implemented.
2014-08-14 23:49:19 +03:00
Yury Delendik
de23d3791e
Fixes image and font embedding
2014-08-14 15:11:27 -05:00
Yury Delendik
0f862e7eb3
Adds svg.js to the generic and singlefile builds
2014-08-14 13:02:30 -05:00