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
Jonas Jenwald
a154ca2dd3
Add strict equalities in src/core/murmurhash3.js
2014-08-01 21:56:04 +02:00
Jonas Jenwald
8f5894d81a
Add strict equalities in src/core/function.js
2014-08-01 21:56:03 +02:00
Jonas Jenwald
97b3eadbc4
Add strict equalities in src/core/fonts.js
2014-08-01 21:56:03 +02:00
Tim van der Meij
00eea3ddb9
Merge pull request #5116 from Snuffleupagus/strict-equalities-src-core
...
Add strict equalities in src/core/* (part 1)
2014-08-01 21:50:05 +02:00
Tim van der Meij
df0b821141
Merge pull request #5113 from Snuffleupagus/strict-equalities-src-display
...
Add strict equalities in src/display/*
2014-08-01 20:51:18 +02:00
Tim van der Meij
0b8b763eda
Merge pull request #5112 from Snuffleupagus/strict-equalities-src-shared
...
Add strict equalities in src/shared/*
2014-08-01 20:00:57 +02:00
Jonas Jenwald
87038e44cd
Add strict equalities in src/core/evaluator.js
2014-08-01 18:40:10 +02:00
Jonas Jenwald
83a4c68df9
Add strict equalities in src/core/core.js
2014-08-01 18:40:10 +02:00
Jonas Jenwald
0012b8803c
Add strict equalities in src/core/colorspace.js
2014-08-01 18:40:09 +02:00
Jonas Jenwald
84503c656d
Add strict equalities in src/core/bidi.js
2014-08-01 18:39:46 +02:00
Jonas Jenwald
2162a19ed9
Add strict equalities in src/core/arithmetic_decoder.js
2014-08-01 18:39:46 +02:00
Jonas Jenwald
9cb09324d2
Add strict equalities in src/core/annotation.js
2014-08-01 18:39:45 +02:00
Jonas Jenwald
4a82dac45b
Add strict equalities in src/display/svg.js
2014-08-01 12:41:03 +02:00
Jonas Jenwald
790ec92a34
Add strict equalities in src/display/pattern_helper.js
2014-08-01 12:40:38 +02:00
Jonas Jenwald
ec6ec13506
Add strict equalities in src/display/metadata.js
2014-08-01 12:40:16 +02:00
Jonas Jenwald
c1f1f2f0e1
Add strict equalities in src/display/canvas.js
2014-08-01 12:39:56 +02:00
Jonas Jenwald
a4b06d7a02
Add strict equalities in src/display/api.js
2014-08-01 12:39:31 +02:00
Jonas Jenwald
ccd71e0a94
Add strict equalities in src/shared/util.js
2014-08-01 12:18:40 +02:00
Jonas Jenwald
42e541a671
Add strict equalities in src/shared/fonts_utils.js
2014-08-01 12:18:35 +02:00
Nicholas Nethercote
adf58ed687
Represent cid chars using integers, not strings.
...
cid chars are 16-bit unsigned integers. Currently we convert them to
single-char strings when inserting them into the CMap, and then convert
them back to integers when extracting them from the CMap. This patch
changes CMap so that cid chars stay in integer format throughout, saving
both time and space.
When loading the PDF from issue #4580 , this change reduces peak RSS from
~600 to ~370 MiB. It also improves overall speed on that PDF by ~26%,
going from 724 ms to 533 ms.
2014-08-01 02:35:17 -07:00
fkaelberer
c03cf20d37
Fix JBIG2 decoding issue #5026
2014-08-01 09:02:25 +02:00
Yury Delendik
ad2ea78280
Merge pull request #5101 from nnethercote/CMap-forEach
...
Avoid expensive for..in loops involving CMaps
2014-07-31 23:03:25 -05:00
Nicholas Nethercote
28687bca75
Optimize CMap.prototype.forEach().
...
This change avoids the element stringification caused by for..in for the
vast majority of CMaps.
When loading the PDF from issue #4580 , this change reduces peak RSS from ~650
to ~600 MiB, and improves overall speed by ~20%, from 902 ms to 713 ms. Other
CMap-heavy documents will also see improvements.
2014-07-30 06:28:47 -07:00
Nicholas Nethercote
b86daed29d
Make CMap.map quasi-private.
...
This makes it easier for the representation to be improved.
2014-07-30 06:26:35 -07:00
Yury Delendik
7026543663
Merge pull request #5059 from timvandermeij/unused-code
...
Removing unused code and enforcing additional JSHint options
2014-07-29 15:04:43 -05:00
Jonas Jenwald
2264748109
Merge pull request #5096 from nnethercote/bidi-length
...
Right-size |chars.length| and |type.length| in bidi().
2014-07-29 12:19:22 +02:00
Nicholas Nethercote
f1d5ec407e
Right-size |chars.length| and |type.length| in bidi().
...
This lets the JS engine resize the array elements buffer immediately,
thus avoiding some intermediate resizings. This can save multiple MiBs
of reallocation in text-heavy files.
2014-07-28 16:35:45 -07:00
Yury Delendik
6038ee7cff
Merge pull request #5063 from Snuffleupagus/ps-parser-avoid-intermediate-string-creation
...
Avoid creating intermediate strings in the PostScriptLexer
2014-07-28 15:07:32 -05:00
Jonas Jenwald
4960af3a4c
Avoid creating intermediate strings in the PostScriptLexer
2014-07-27 13:51:28 +02:00
Jonas Jenwald
a5c98aab36
Re-factor parsing of the Linearization dictionary
2014-07-27 12:56:09 +02:00
Jonas Jenwald
86f9503876
Remove src/core/cidmaps.js
2014-07-25 21:53:17 +02:00
Jonas Jenwald
c3c72948b9
Stop including cidmaps.js
...
In b5b94a4af3
, i.e. PR #4259 , we stopped using cidmaps.js. Despite that, it's still included when PDF.js is built. At almost 0.5 MB (and approx. 7000 lines), this is currently the single largest file in the codebase.
Including such a large file in the builds, when it is not actually used, seems extremely wasteful; hence this patch.
2014-07-25 21:53:09 +02:00
Yury Delendik
1e21bac9d3
Merge pull request #5077 from Snuffleupagus/issue-5039
...
Fix loading of PDF files with invalid or missing Type3 characters (issue 5039)
2014-07-25 14:34:51 -05:00
Tim van der Meij
62e6265fb3
Merge pull request #5074 from nnethercote/readPostScriptTable-join
...
Use Array.join to build up strings in readPostScriptTable().
2014-07-25 21:26:54 +02:00
Yury Delendik
5d4eebc6a7
Merge pull request #5034 from pramodhkp/fixupgstate2
...
[SVG] Adds clip operator, fixes setGState, fill, stroke operators
2014-07-25 13:52:29 -05:00
pramodhkp
6e4dd83a4d
Added endPath, endText. fixes extra <g> elements
2014-07-25 23:30:29 +05:30
pramodhkp
2380b38b27
Fixed setGState, viewport transform
2014-07-25 23:21:23 +05:30
pramodhkp
a55c9856e9
Misc variable initialization
2014-07-25 23:21:23 +05:30
pramodhkp
0688fd3d70
Added fill, stroke, line-join & font attr
2014-07-25 23:20:55 +05:30
pramodhkp
03f1de3403
Added clip operator
2014-07-25 23:13:52 +05:30
Yury Delendik
2aea7d7047
Merge pull request #5078 from nnethercote/Ref-toString
...
Optimize Ref_toString().
2014-07-25 10:10:10 -05:00
Nicholas Nethercote
1039791472
Use Array.join to build up strings in readPostScriptTable().
...
This avoids about 5 MiB of string allocations on one test case.
2014-07-24 16:12:08 -07:00
Tim van der Meij
41faa78368
Fixes typo in promises implementation for legacy browsers
2014-07-24 17:11:22 +02:00
Nicholas Nethercote
856e1c600b
Optimize Ref_toString().
...
I have a large PDF where this function is called 1.6 million times
during loading. Minimizing the string concatenations reduces the
cumulative allocations done by Firefox within this function from 113 MB
to 48 MB.
2014-07-24 06:49:56 -07:00
Jonas Jenwald
2485f11829
Fix loading of PDF files with invalid or missing Type3 characters (issue 5039)
2014-07-24 15:03:22 +02:00
Nicholas Nethercote
501446ccc4
Optimize common cases in hexToStr().
...
This avoids the creation of over two million array objects when viewing
http://www.dynacw.co.jp/Portals/3/fontsamplepdf/sample_4942546800828.pdf ,
and reduces load time from 76 to 73 ms.
2014-07-22 23:26:03 -07:00
Nicholas Nethercote
c7f02d2c8e
Minimize memory usage of font-related arrays.
...
This patch replaces some vanilla arrays with typed arrays, and avoids
some array copying.
It reduces the peak RSS when viewing
http://www.dynacw.co.jp/Portals/3/fontsamplepdf/sample_4942546800828.pdf
from ~940 MiB to ~750 MiB, and reduces its load time from 83 to 76 ms.
2014-07-22 22:47:45 -07:00
Jonas Jenwald
f13c217b25
Fix another seac regression (issue 4801)
2014-07-22 21:44:13 +02:00
Jonas Jenwald
b950118681
Revert commit fc73e2e
(PR 5005) for breaking certain PDF files
2014-07-22 21:17:57 +02:00
Yury Delendik
53320ce734
Merge pull request #5012 from Snuffleupagus/issue-5010
...
Prevent CMapFactory.create from failing by passing the necessary parameters from PartialEvaluator_readToUnicode (issue 5010)
2014-07-22 10:54:35 -05:00
Yury Delendik
584fef90ab
Merge pull request #5037 from Snuffleupagus/issue-5036
...
Add |fillRgb| method to LabCS
2014-07-21 09:55:55 -05:00
Tim van der Meij
7586d777eb
Enforcing JSHint's undef option
2014-07-19 16:41:07 +02:00
Tim van der Meij
34728ee49b
Removing unused code
2014-07-18 22:34:50 +02:00
Tim van der Meij
4be90c35f8
Merge pull request #5021 from CodingFabian/issue-5020
...
Fixes mesh fill pattern with optional matrix
2014-07-18 20:51:44 +02:00
Jonas Jenwald
9c6316fc15
Merge pull request #5005 from fkaelberer/faster_ChunkedStream_getByte
...
Faster chunkedStream_getByte()
2014-07-18 18:23:49 +02:00
Tim van der Meij
a7800c276b
Merge pull request #5015 from Snuffleupagus/zero-WebGL-canvases
...
Zero the height and width of the WebGL canvases on cleanup
2014-07-16 17:07:18 +02:00
Tim van der Meij
e97efaa70a
Merge pull request #5033 from nnethercote/makeCssRgb
...
Avoid creating intermediate strings in Util.makeCssRgb().
2014-07-16 16:10:29 +02:00
Fabian Lange
dd2adf6200
Fixes mesh fill pattern with optional matrix ( #5020 )
...
In the referenced issue, there is a PDF which uses a fill pattern which does not
have a matrix defined. This causes singularValueDecompose2dScale to fail with
undefined property error when accessing elements of that matrix.
This fix will only use the matrix when it is defined. The output for the PDF in
question now looks identical to chrome and preview with respect to the gradient
fill pattern.
2014-07-13 15:45:12 +02:00
Jonas Jenwald
0237d5036a
Merge pull request #5025 from nnethercote/share-zero-length-buffers
...
Improve how DecodeStream handles empty buffers.
2014-07-13 12:13:06 +02:00
Yury Delendik
b5e5de00df
Merge pull request #5017 from Snuffleupagus/bug-1028735
...
[CIDFontType2] Map characters missing in toUnicode to the private use area (bug 1028735 and issue 4881)
2014-07-12 07:18:07 -05:00
Jonas Jenwald
1cb4de2227
Add |fillRgb| method to LabCS
2014-07-10 12:06:19 +02:00
Nicholas Nethercote
31c613f064
Avoid creating intermediate strings in Util.makeCssRgb().
...
On one example (the Wuppertal map) this avoids the creation of over
230,000 intermediate strings.
2014-07-08 21:49:19 -07:00
pramodhkp
afd853e962
Added units for lengths
2014-07-08 23:03:17 +05:30
Jonas Jenwald
a7c786775d
[CIDFontType2] Map characters missing in toUnicode to the private use area (bug 1028735 and issue 4881)
2014-07-05 00:18:51 +02:00
pramodhkp
86e584d767
Memory optimzation for constructPath
2014-07-04 20:43:40 +05:30
Nicholas Nethercote
a483c80fc3
Make QueueOptimizer easier to read.
...
QueueOptimizer is really hard to read. Enough so that it's blocking my
efforts to streamline the representation used for operator lists.
This patch improves its readability in the following ways.
- More descriptive variable names make the sequence checking much clearer,
as do additional comments.
- The addState() functions now return the index of the first op past the
sequence, instead of setting context.currentOperation to the last op of
the sequence.
- The loop in optimize() is clearer.
- The array modification in the fourth addState() function is much clearer
-- we're just removing trios of ops.
- All four |addState| functions are now more consistent with each other.
I used some debug printfs to find documents where these optimizations are
used and then checked that the number of optimized ops was the same before
and after my changes.
2014-07-03 19:16:31 -07:00
Nicholas Nethercote
db866945b7
Improve how DecodeStream handles empty buffers.
...
DecodeStream currently initializes its |buffer| field to |null|, which
is reasonable, because lots of DecodeStreams never need to instantiate a
buffer. But this requires various special cases in the code.
This patch change it so DecodeStreamClosure has a single empty
Uint8Array which gets shared between all buffers upon initialization.
This avoids the special cases.
DecodeStream.prototype.ensureBuffer() is really hot, and this removes a
test from the fast path. For one 226 page scanned document this sped up
rendering by about 2%.
2014-07-02 18:53:21 -07:00
fkaelberer
fc73e2e173
use getBytes() instead of looping over getByte()
2014-06-27 09:09:54 +02:00
Jonas Jenwald
c5f4051a75
A few small optimizations of adjustMapping
...
Replace a couple of |in| checks with comparisons against undefined.
2014-06-27 00:59:42 +02:00
Jonas Jenwald
c121def806
A few small optimizations for CIDFontType2 fonts
...
Cache a constant length and replace one usage of |in| with a comparison against undefined.
2014-06-27 00:52:54 +02:00
Jonas Jenwald
04975acceb
Prevent CMapFactory.create from failing by passing the necessary parameters from PartialEvaluator_readToUnicode (issue 5010)
2014-06-27 00:46:16 +02:00
fkaelberer
9a41659ae7
Faster chunkedStream_getByte()
2014-06-26 22:34:00 +02:00
pramodhkp
7efd50e64d
Added paintJpegXObject
2014-06-25 03:55:14 +05:30
pramodhkp
d799a18b74
Added paintSolidColorImageMask
2014-06-25 02:48:11 +05:30
pramodhkp
c8a4ab3a19
Optimization of save/restore usage
2014-06-25 02:47:29 +05:30
Yury Delendik
6d5a04149b
Merge pull request #4993 from pramodhkp/rectelmnt
...
Combine re element into constructPath
2014-06-24 09:27:21 -05:00
pramodhkp
8407d28c9e
Combine re element into constructPath
2014-06-25 00:27:42 +05:30
Jonas Jenwald
8ad1ea3c5f
Zero the height and width of the WebGL canvases on cleanup
2014-06-24 13:52:22 +02:00
Yury Delendik
10db93be29
Merge pull request #4980 from Snuffleupagus/bug-1027533
...
Additional heuristics to recognize unknown glyphs for toUnicode (bug 1027533)
2014-06-23 21:56:13 -05:00
Yury Delendik
bb7e7d33c5
Merge pull request #4976 from CodingFabian/restructure-evaluator-read
...
Restructured EvaluatorPreprocessor_read to be more natural.
2014-06-23 21:50:14 -05:00
Yury Delendik
c28839b2f3
Merge pull request #4944 from Snuffleupagus/issue-4934
...
Don't blindly trust toUnicode when building toFontChar for non-standard fonts without a font file (issue 4934)
2014-06-23 21:49:24 -05:00
Fabian Lange
60f67c3961
Restructured EvaluatorPreprocessor_read to be more natural.
2014-06-23 23:35:25 +02:00
Yury Delendik
3ad58db7e8
Merge pull request #4982 from nnethercote/use-null-for-zero-args
...
Use null instead of [] for ops with no args.
2014-06-23 15:38:48 -05:00
Nicholas Nethercote
081866a184
Use null instead of [] for ops with no args.
...
This reduces peak RSS on one test file from ~600 to ~560 MiB.
2014-06-22 16:03:48 -07:00
Jonas Jenwald
b19bb74813
Additional heuristics to recognize unknown glyphs for toUnicode (bug 1027533)
2014-06-20 09:57:16 +02:00
Yury Delendik
834f466c05
Fixes SVG transforms on restore
2014-06-19 23:18:04 -05:00
Yury Delendik
6258ae61d5
Merge pull request #4979 from pramodhkp/svg-v3
...
SVG Viewer Example demo
2014-06-19 21:16:21 -05:00
pramodhkp
dd253aadeb
SVG Viewer example demo
2014-06-20 08:25:05 +05:30
Yury Delendik
84157e039d
Merge pull request #4973 from nnethercote/better-ref-keys
...
Factor out repeated Ref key string generation code.
2014-06-19 21:00:09 -05:00
Nicholas Nethercote
1ad3ffbc7b
Factor out repeated Ref key string generation code.
...
In src/core/obj.js, we convert a Ref to a string to index into a table like
this: 'R1.0'. This conversion is repeated numerous times.
This patch factors out the conversion into a new function.
Ref.prototype.toString().
2014-06-19 18:22:39 -07:00
Yury Delendik
c0a6b0f308
Merge pull request #4971 from yurydelendik/rm-suppressEncryption
...
Removes error catch from fetchUncompressed()
2014-06-18 22:03:09 -05:00
Yury Delendik
b557b87fc9
Merge pull request #4972 from nnethercote/preprocessor-read
...
Avoid allocating return object in EvaluatorPreprocessor_read().
2014-06-18 22:00:31 -05:00
Nicholas Nethercote
17170af3c7
Avoid allocating return object in EvaluatorPreprocessor_read().
...
This function can be called 100s of 1000s or even millions of times, and the
allocated return object accounts for 10% of all GC thing allocations for some
documents. It's easy to avoid, which reduces stress on the garbage collector,
and this patch does that.
2014-06-18 16:41:29 -07:00
Yury Delendik
623fa29300
Removes error catch from fetchUncompressed()
2014-06-18 18:30:27 -05:00
Yury Delendik
fbdab2c7c5
Not ignoring MissingDataException exception.
2014-06-18 18:24:54 -05:00
Yury Delendik
cf4bc42e33
Merge pull request #4968 from nnethercote/glyphBuf
...
Build up textChunk.str more efficiently.
2014-06-18 17:51:07 -05:00
Jonas Jenwald
7a83291c14
Merge pull request #4970 from yurydelendik/AnnotationUtils
...
Fixes AnnotationUtils in the extension build
2014-06-19 00:44:42 +02:00
Yury Delendik
88fd1aa78b
Removes PDFJS.Annotation
2014-06-18 16:58:11 -05:00
Yury Delendik
c1c950ce74
Fixes AnnotationUtils in the extension build
2014-06-18 16:42:08 -05:00
Tim van der Meij
4c759527d1
Implements onerror for JpegStreams
2014-06-18 23:02:52 +02:00
Jonas Jenwald
2282c98500
Merge pull request #4965 from yurydelendik/annotations
...
Splits shared/annotation.js into core/ and display/
2014-06-18 17:01:38 +02:00
Nicholas Nethercote
bce7601480
Build up textChunk.str more efficiently.
...
PartialEvaluator.getTextContent() builds up textChunk strings 1 char at a time,
creating many 100s of 1000s of intermediate strings along the way. This patch
make it instead push chars to an array and then join them at the end, as we
have done in numerous other places.
2014-06-18 07:48:22 -07:00
Nicholas Nethercote
4428cebdbc
Add ChunkedStream.ensureByte().
...
This new function is much faster than ensureRange(pos, pos+1), which is a very
common case.
This speeds up the rendering of some test cases (including the Tracemonkey
paper) by 4--5%.
2014-06-17 21:33:48 -07:00
Yury Delendik
bdeca30fbf
Splits shared/annotation.js into core/ and display/
2014-06-17 17:43:33 -05:00
Yury Delendik
0f0f0688a1
Merge pull request #4946 from Snuffleupagus/issue-3862
...
Refactor fake worker loading (issue 3862)
2014-06-17 13:27:01 -05:00
Yury Delendik
ea16723448
Merge pull request #4951 from pramodhkp/getoperatorlist
...
Added getOperatorList to api.js
2014-06-17 09:39:09 -05:00
pramodhkp
1d00e9d13c
Added getOperatorList to api.js
2014-06-18 01:30:42 +05:30
Yury Delendik
bad24bf707
Merge pull request #4950 from fkaelberer/fasterJPEGtransform
...
Faster JPEG transform
2014-06-17 09:03:23 -05:00
Yury Delendik
11302f09a4
Merge pull request #4959 from nnethercote/zero-cache-canvases
...
Zero the height and width of cached canvases before deleting them.
2014-06-17 08:26:04 -05:00
Yury Delendik
5a2e511cbd
Merge pull request #4955 from timvandermeij/rename-concatenate
...
Renames concatenateToArray to appendToArray
2014-06-17 08:21:47 -05:00
Jonas Jenwald
ab67e1c272
Let Parser_makeFilter return NullStream when an invalid stream is encountered (issue 3417)
2014-06-17 12:03:34 +02:00
fkaelberer
f9cde5d93e
faster JPEG transform
2014-06-17 10:09:17 +02:00
Nicholas Nethercote
7ef7f95374
Zero the height and width of the Cached canvases before deleting.
...
This reduces peak RSS by about 300 MiB on my Mac when scrolling slowly through
the first 30 pages of a scanned black and white document.
2014-06-16 22:58:11 -07:00
Jonas Jenwald
22cfcbcf8a
Merge pull request #4952 from yurydelendik/telemetry
...
Collect More Telemetry Data
2014-06-17 00:36:58 +02:00
Yury Delendik
0cd28ebfa3
Telemetry for used stream and font types
2014-06-16 16:41:04 -05:00
Tim van der Meij
9c072a5d4b
Renames concatenateToArray to appendToArray
2014-06-16 22:10:10 +02:00
Jonas Jenwald
3c78c7b8bc
Refactor fake worker loading (issue 3862)
2014-06-15 15:52:05 +02:00
Jonas Jenwald
158790981c
Don't blindly trust toUnicode when building toFontChar for non-standard fonts without a font file (issue 4934)
2014-06-14 22:59:08 +02:00
Yury Delendik
9f51e46917
Refactoring error reporting in JPX
2014-06-13 18:22:42 -05:00
fkaelberer
894d9fe085
Fix #3591 / list unsupported options
2014-06-13 16:41:27 -05:00
Yury Delendik
dd165f2918
SHA512 optimizations
2014-06-13 15:12:50 -05:00
Daniel West
1fce2856c6
Added support for decrypting PDF 1.7/2.0 Algorithm 5 revision 5 and 6.
...
*Added AES128 Encryption
*Added AES258 Encryption/Decryption
*Added SHA256
*Added SHA512
*Added class to handle 8 byte integers and associated bit operations
*Added SHA384
*Added routines to handle new algorithm and perform PDF2.0 hashing.
2014-06-13 13:05:47 -05:00
Yury Delendik
2efbdfe8d4
Merge pull request #4834 from dferer/canvas-max-size
...
Limit the size of canvases to 5MP (iOS restriction)
2014-06-13 09:37:42 -05:00
Nicholas Nethercote
7923eb7edb
Fix mishandling of incomplete, inverted masks.
2014-06-13 06:14:52 -07:00
Samuel Chantaraud
952545e20f
Limit the size of canvases to 5MP (iOS restriction)
2014-06-12 17:58:58 -04:00
Yury Delendik
b37b33829e
Merge pull request #4915 from dferer/fix-4914
...
Fix #4914
2014-06-12 12:59:02 -05:00
Jonas Jenwald
c0250e16e3
Return ErrorFont in loadFont when the fontRef is undefined
2014-06-12 12:46:39 +02:00
Samuel Chantaraud
f362b3c744
Fix #4914 by ignoring hidden annotation
2014-06-11 10:41:43 -04:00
Yury Delendik
1ac8ca66f7
Fixes optional backdrop regression
2014-06-10 15:47:25 -05:00
Jonas Jenwald
7802a7ab97
Handle cases where the fontName contains non-alphanumeric characters (issue 4909)
2014-06-10 17:25:49 +02:00
Yury Delendik
b2d8e73d54
Merge pull request #4895 from p01/Small_optimizations_1
...
Small optimizations 1
2014-06-10 10:09:12 -05:00
Yury Delendik
12bfd206d9
Merge pull request #4867 from yurydelendik/nonalign32
...
Fixes murmurhash for old webkit.
2014-06-10 09:16:36 -05:00
Yury Delendik
cff2c3afc1
Merge pull request #4892 from yurydelendik/issue4890
...
Fixes masked JPEG image
2014-06-10 09:16:12 -05:00
Yury Delendik
fc85cfdb83
Merge pull request #4907 from CodingFabian/fix-4906
...
add object id to streams to prevent infinite loops.
2014-06-10 08:56:25 -05:00
p01
6731de6829
Minor refactoring of EvaluatorPreprocessor_read
2014-06-10 12:37:40 +02:00
p01
e0bf7e2151
Optimized genericComposeSMask
...
Declaring the composition and backgdrop functions outside of genericComposeSMask
is more efficient.
2014-06-10 12:37:39 +02:00
p01
412febe4a4
canvas.js minor optimizations
2014-06-10 12:37:39 +02:00
p01
35e418c603
Optimized CanvasGraphics_executeOperatorList 66% faster
2014-06-10 12:37:38 +02:00
p01
d4a01f6034
evaluator.js minor optimizations
2014-06-10 12:37:37 +02:00
p01
0a51b1e616
utils.js optimization of isFOO methods
2014-06-10 12:37:36 +02:00