Commit Graph

2142 Commits

Author SHA1 Message Date
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
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
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
Yury Delendik
2b87ff9286 Merge pull request #5008 from nnethercote/better-QueueOpt
Make QueueOptimizer easier to read.
2014-08-05 16:59:26 -05:00
Jonas Jenwald
cb4a847347 Merge pull request #5134 from yurydelendik/fun4
Improves speed of the functions
2014-08-05 23:51:03 +02:00
Yury Delendik
12b50486de Merge pull request #5136 from timvandermeij/ccitt-lines
Properly set this.eof in CCITTFaxStream
2014-08-05 12:49:50 -05:00
Tim van der Meij
5cc7d23066 Properly set this.eof in CCITTFaxStream 2014-08-05 19:08:00 +02:00
fkaelberer
5b83e0b9a3 Faster JBIG2 bitmap decoding 2014-08-05 16:12:45 +02:00
Nicholas Nethercote
51055e5836 Make IdentityCMaps more compact.
IdentityCMap uses an array to represent a 16-bit unsigned identity
function. This is very space-inefficient, and some files cause multiple
IdentityCMaps to be instantiated (e.g. the one from #4580 has 74).

This patch make the representation implicit.

When loading the PDF from issue #4580, this change reduces peak RSS from
~370 to ~280 MiB. It also improves overall speed on that PDF by ~30%,
going from 522 ms to 366 ms.
2014-08-05 03:01:39 -07:00
Yury Delendik
6865c284a7 Merge pull request #5111 from nnethercote/better-cidchars
Represent cid chars using integers, not strings.
2014-08-04 22:26:55 -05:00
Yury Delendik
f750e35224 Optimizes functions to not create arrays 2014-08-04 11:23:11 -05:00
Yury Delendik
cb81bd6be6 Compiles some of the FunctionType 4 2014-08-04 11:21:31 -05:00
Jonas Jenwald
8ecbb4da05 Adjust the heuristics to recognize more cases of unknown glyphs for |toUnicode| (issue 5070) 2014-08-03 21:18:23 +02:00
Jonas Jenwald
b918df3547 Re-factor heuristics to recognize unknown glyphs for |toUnicode| 2014-08-03 21:12:36 +02:00
Jonas Jenwald
4b54d6fd43 Add strict equalities in src/core/stream.js 2014-08-02 17:59:14 +02:00
Jonas Jenwald
7fa204c805 Add strict equalities in src/core/parser.js 2014-08-02 17:37:24 +02:00
Tim van der Meij
cb59b5772b Merge pull request #5120 from Snuffleupagus/strict-equalities-src-core-2
Add strict equalities in src/core/* (part 2)
2014-08-02 13:51:14 +02:00
Tim van der Meij
4899e9e54f Use strict equalities in src/core/jbig2.js 2014-08-01 23:02:57 +02:00
Tim van der Meij
5d0fde4a2c Use strict equalities in src/core/jpx.js 2014-08-01 23:02:57 +02:00
Tim van der Meij
2796d1bf10 Use strict equalities in src/core/jpg.js 2014-08-01 23:02:56 +02:00
Tim van der Meij
160c7cab33 Use strict equalities in src/core/image.js 2014-08-01 23:02:55 +02:00
Jonas Jenwald
fb9fea2f36 Add strict equalities in src/core/worker.js 2014-08-01 22:17:47 +02:00
Jonas Jenwald
c9fb3e1b6d Add strict equalities in src/core/ps_parser.js 2014-08-01 22:02:10 +02:00
Jonas Jenwald
ee371fe6b2 Add strict equalities in src/core/pattern.js 2014-08-01 21:56:04 +02:00
Jonas Jenwald
ee0c0dd8a9 Add strict equalities in src/core/obj.js 2014-08-01 21:56:04 +02:00