Commit Graph

1964 Commits

Author SHA1 Message Date
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
Yury Delendik
bc574aa629 Refactors SVG api 2014-08-14 12:56:11 -05:00
Jonas Jenwald
9ef0d0b878 Fix the error handling for CMaps that fail to load 2014-08-14 16:29:10 +02:00
Yury Delendik
0ad323f621 Adds width at the beginning of the Type2 charstring 2014-08-13 21:15:40 -05:00
pramodhkp
6d53fc4db7 Minor changes for api.js, font_loader.js and svg.js 2014-08-14 01:01:09 +05:30
Tim van der Meij
44fbf0ce14 Miscellaneous code improvements for svg.js 2014-08-13 20:31:21 +02:00
Jonas Jenwald
06b5d97bc6 Remove two instances of leftover console.log debug statements
The `console.log` statement in evaluator_spec.js is obviously not needed. In obj.js it could have been replaced by `info`, but that seemed unnecessary given the already existing `error`.
2014-08-13 14:29:46 +02:00
Jonas Jenwald
c3691500fa Merge pull request #5172 from nnethercote/readCharCode-retval
Avoid an allocation in readCharCode().
2014-08-13 11:03:07 +02:00
Nicholas Nethercote
61e6b576d4 Avoid an allocation in readCharCode().
readCharCode() returns two values, and currently allocates a length-2
array on every call to do so. This change makes it instead us a
passed-in object which can be reused.

This tiny change reduces the total JS allocations done for the document
in Mozilla bug 992125 by 4.2%.
2014-08-12 16:12:58 -07:00
Nicholas Nethercote
7cbd057deb Avoid unnecessary array allocations in EvaluatorPreprocessor_read().
EvaluatorPreprocessor_read() is called in two cases. For the normal
layer, the args array it produces is used beyond the bounds of the loop
in which EvaluatorPreprocessor_read() is called.

But for the text layer, the args array is used in a very short-term
fashion. This change reworks things so that a single array is repeatedly
used for the text layer. This reduces total JS allocations for the
Spoorkaart map by 11%, and has similar effects on many other PDFs.
2014-08-11 16:57:40 -07:00
Brian Ng
5365fa9de7 Fix typo 2014-08-11 11:40:49 -05:00
Yury Delendik
dae92b9cc7 Uses float number formatter to print numbers in SVG 2014-08-11 11:18:32 -05:00
Yury Delendik
ab8270ae3a Fixes searchRange calculation 2014-08-10 14:11:04 -05:00
Yury Delendik
42771159ca Removes stringToArray 2014-08-10 14:11:04 -05:00
Yury Delendik
350556f085 Removes bytesToString/stringToArray conversions in the font.js 2014-08-10 14:11:04 -05:00
Yury Delendik
4ce1b1e987 Merge pull request #5150 from nnethercote/toUnicode
Fix #4935
2014-08-10 14:07:26 -05:00
Tim van der Meij
b6e4ac9070 Nit fixes for svg.js 2014-08-10 14:40:49 +02:00
Yury Delendik
99b08ed223 Merge pull request #5162 from yurydelendik/pramodhkp-fixupgstate2
[SVG] Reduces amount of used memory during PNG creation.
2014-08-09 15:56:11 -05:00
Yury Delendik
56f0539045 Reduces amount of used memory during PNG creation. 2014-08-09 15:53:05 -05:00
pramodhkp
458b69b649 Adds image and mask features, fixes clippath 2014-08-10 01:06:43 +05:30
Yury Delendik
13f1a964a7 Merge pull request #5154 from Rob--W/aes-padding-5152
AES cipher: make padding optional
2014-08-09 09:25:54 -05:00
Jonas Jenwald
66c56ac546 Fixes a regression from PR 4982
After PR 4982, the rendering of the first two pages of http://www.openmagazin.cz/pdf/2011/openMagazin-2011-04.pdf (from issue 215) no longer completes.

The issue is that we cannot have `args === null` in `PartialEvaluator_buildPath`, but *must* use an empty array instead.

In this patch I've also moved the `argsLength` variable definition in `EvaluatorPreprocessor_read`, to make sure that it's always defined.
2014-08-08 13:19:18 +02:00
Rob Wu
58cd3349db AES cipher: make padding optional
Fixes #5152
2014-08-08 12:36:29 +02:00
Nicholas Nethercote
f82977caf9 Simplify isIdentityUnicode detection. 2014-08-08 02:02:42 -07:00
Nicholas Nethercote
6c8cca1284 Add IdentityToUnicodeMap class.
When loading the PDF from issue #4935, this change reduces peak RSS from
~2400 to ~300 MiB, and improves overall speed by ~81%, from 6336 ms to
1222 ms.
2014-08-07 20:45:11 -07:00
Nicholas Nethercote
9576047f0d Add ToUnicodeMap class. 2014-08-07 20:05:24 -07:00
Yury Delendik
669a4d196e Merge pull request #5114 from fkaelberer/fasterJBIG2decodeBitmap
Faster JBIG2 bitmap decoding
2014-08-07 16:14:30 -05:00
Tim van der Meij
238a5f8a30 Fixes CCITTFaxStream regression 2014-08-07 22:07:20 +02:00
Jonas Jenwald
643ad37f2a Revert commit 9a41659 (PR 5005) for breaking the loading of certain PDF files in the Firefox addon when range requests are active 2014-08-07 12:07:45 +02:00
Yury Delendik
57860149e9 Merge pull request #5135 from nnethercote/identity-cmap-proper
Make IdentityCMaps more compact.
2014-08-06 09:11:08 -05:00
Jonas Jenwald
179bb2e136 Merge pull request #5140 from yurydelendik/fetchAsync
Removes some bind() calls from fetchAsync
2014-08-06 12:34:27 +02:00
Yury Delendik
682b93ac9e Fixes lint errors 2014-08-05 21:55:59 -05:00
Yury Delendik
cc180d7e2b Removes some bind() calls from fetchAsync 2014-08-05 21:22:12 -05:00
Yury Delendik
46a9a35ddc Merge pull request #5071 from nnethercote/font-savings
Optimize a font-heavy document
2014-08-05 18:57:46 -05:00
Yury Delendik
fa53fcbf57 Merge pull request #5095 from Snuffleupagus/issue-5070
Adjust the heuristics to recognize more cases of unknown glyphs for |toUnicode| (issue 5070)
2014-08-05 17:41:38 -05:00