Commit Graph

7459 Commits

Author SHA1 Message Date
Jonas Jenwald
8a7499b190 Update linting on Travis to cover *.jsm files (PR 5406 followup)
Trivial followup to PR 5406.
2014-12-23 13:07:35 +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
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
Yury Delendik
a17735d538 Merge pull request #5536 from Snuffleupagus/issue-4722
Add fallback for non-embedded "Century Gothic" CIDFontType2 font (issue 4722 and bug 879561)
2014-12-18 16:29:46 -06: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
Jonas Jenwald
4a2c38f42f Merge pull request #5562 from timvandermeij/progression-tests
Test case for issue 5481
2014-12-18 22:03:33 +01:00
Fabian Lange
5405b1c8e4 minor improvements and code cleanup for canvas.js 2014-12-18 21:59:40 +01:00
Tim van der Meij
a340927687 Test case for issue 5481 2014-12-18 21:26:02 +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
cff91843d5 Merge pull request #5510 from dustyrockpyle/master
Added page break hints in viewer css.
2014-12-18 11:24:50 -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
Jonas Jenwald
59ccf49a2a Merge pull request #5553 from timvandermeij/jp2-tests
Two JPX test cases for recently merged PRs
2014-12-17 23:18:01 +01:00
Tim van der Meij
36fce7db7e Test case for issue 5475 2014-12-17 22:46:47 +01:00
Tim van der Meij
16833159a9 Test case for issue 5549 2014-12-17 22:42:06 +01:00
Tim van der Meij
31811b619f Merge pull request #5551 from Snuffleupagus/remove-amo-link
Remove the link to the AMO extension from the README
2014-12-17 22:28:57 +01: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
Jonas Jenwald
86d7453c93 Remove the link to the AMO extension from the README 2014-12-17 21:49:49 +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
Tim van der Meij
01cf21955e Merge pull request #5406 from Snuffleupagus/lint-firefox-jsm
[Firefox] Enable linting of *.jsm files and update the code style in extensions/firefox/content
2014-12-15 20:54:22 +01: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
Yury Delendik
20bf84ac54 Merge pull request #5532 from Snuffleupagus/test-pr-5276
Add a (linked) test case for bug 1108753 (PR 5276)
2014-12-08 23:32:56 -06:00
Jonas Jenwald
3ea81019fe Add a (linked) test case for bug 1108753 (PR 5276)
When submitting PR 5276 there wasn't a good PDF file to include in the test suite. However, with https://bugzilla.mozilla.org/show_bug.cgi?id=1108753, we now have a better source for a test file, hence this patch.
2014-12-09 01:07:38 +01: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
Tim van der Meij
c28f7d2535 Merge pull request #5528 from Snuffleupagus/test-bug-1064894
Add a (linked) test case for bug 1064894
2014-12-08 21:32:55 +01:00
Jonas Jenwald
df1364a993 Add a (linked) test case for bug 1064894
This should have been part of PR 5284.
2014-12-06 14:15:08 +01: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
Yury Delendik
37fe1d14e4 Merge pull request #5516 from Snuffleupagus/issue-5509
Fallback to the |Dummy| Pattern when we fail to parse a Shading Pattern (issue 5509)
2014-12-05 08:21:01 -08: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