Browse Source

PDF.js version 1.0.956

master v1.0.956
Pdf Bot 10 years ago
parent
commit
7e02e0ec60
  1. 2
      bower.json
  2. 52
      build/pdf.combined.js
  3. 4
      build/pdf.js
  4. 52
      build/pdf.worker.js
  5. 2
      package.json

2
bower.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.0.954", "version": "1.0.956",
"main": [ "main": [
"build/pdf.js", "build/pdf.js",
"build/pdf.worker.js" "build/pdf.worker.js"

52
build/pdf.combined.js

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.954'; PDFJS.version = '1.0.956';
PDFJS.build = '8e6b97e'; PDFJS.build = 'de98380';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
@ -41686,6 +41686,23 @@ var JpxImage = (function JpxImageClosure() {
// Section B.6 Division resolution to precincts // Section B.6 Division resolution to precincts
var precinctWidth = 1 << dimensions.PPx; var precinctWidth = 1 << dimensions.PPx;
var precinctHeight = 1 << dimensions.PPy; var precinctHeight = 1 << dimensions.PPy;
// Jasper introduces codeblock groups for mapping each subband codeblocks
// to precincts. Precinct partition divides a resolution according to width
// and height parameters. The subband that belongs to the resolution level
// has a different size than the level, unless it is the zero resolution.
// From Jasper documentation: jpeg2000.pdf, section K: Tier-2 coding:
// The precinct partitioning for a particular subband is derived from a
// partitioning of its parent LL band (i.e., the LL band at the next higher
// resolution level)... The LL band associated with each resolution level is
// divided into precincts... Each of the resulting precinct regions is then
// mapped into its child subbands (if any) at the next lower resolution
// level. This is accomplished by using the coordinate transformation
// (u, v) = (ceil(x/2), ceil(y/2)) where (x, y) and (u, v) are the
// coordinates of a point in the LL band and child subband, respectively.
var isZeroRes = resolution.resLevel === 0;
var precinctWidthInSubband = 1 << (dimensions.PPx + (isZeroRes ? 0 : -1));
var precinctHeightInSubband = 1 << (dimensions.PPy + (isZeroRes ? 0 : -1));
var numprecinctswide = (resolution.trx1 > resolution.trx0 ? var numprecinctswide = (resolution.trx1 > resolution.trx0 ?
Math.ceil(resolution.trx1 / precinctWidth) - Math.ceil(resolution.trx1 / precinctWidth) -
Math.floor(resolution.trx0 / precinctWidth) : 0); Math.floor(resolution.trx0 / precinctWidth) : 0);
@ -41693,18 +41710,15 @@ var JpxImage = (function JpxImageClosure() {
Math.ceil(resolution.try1 / precinctHeight) - Math.ceil(resolution.try1 / precinctHeight) -
Math.floor(resolution.try0 / precinctHeight) : 0); Math.floor(resolution.try0 / precinctHeight) : 0);
var numprecincts = numprecinctswide * numprecinctshigh; var numprecincts = numprecinctswide * numprecinctshigh;
var precinctXOffset = Math.floor(resolution.trx0 / precinctWidth) *
precinctWidth;
var precinctYOffset = Math.floor(resolution.try0 / precinctHeight) *
precinctHeight;
resolution.precinctParameters = { resolution.precinctParameters = {
precinctXOffset: precinctXOffset,
precinctYOffset: precinctYOffset,
precinctWidth: precinctWidth, precinctWidth: precinctWidth,
precinctHeight: precinctHeight, precinctHeight: precinctHeight,
numprecinctswide: numprecinctswide, numprecinctswide: numprecinctswide,
numprecinctshigh: numprecinctshigh, numprecinctshigh: numprecinctshigh,
numprecincts: numprecincts numprecincts: numprecincts,
precinctWidthInSubband: precinctWidthInSubband,
precinctHeightInSubband: precinctHeightInSubband
}; };
} }
function buildCodeblocks(context, subband, dimensions) { function buildCodeblocks(context, subband, dimensions) {
@ -41731,18 +41745,21 @@ var JpxImage = (function JpxImageClosure() {
tbx1: codeblockWidth * (i + 1), tbx1: codeblockWidth * (i + 1),
tby1: codeblockHeight * (j + 1) tby1: codeblockHeight * (j + 1)
}; };
// calculate precinct number
var pi = Math.floor((codeblock.tbx0 -
precinctParameters.precinctXOffset) /
precinctParameters.precinctWidth);
var pj = Math.floor((codeblock.tby0 -
precinctParameters.precinctYOffset) /
precinctParameters.precinctHeight);
precinctNumber = pj + pi * precinctParameters.numprecinctswide;
codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0); codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0);
codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0); codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0);
codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1); codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1);
codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1); codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1);
// Calculate precinct number for this codeblock, codeblock position
// should be relative to its subband, use actual dimension and position
// See comment about codeblock group width and height
var pi = Math.floor((codeblock.tbx0_ - subband.tbx0) /
precinctParameters.precinctWidthInSubband);
var pj = Math.floor((codeblock.tby0_ - subband.tby0) /
precinctParameters.precinctHeightInSubband);
precinctNumber = pi + (pj * precinctParameters.numprecinctswide);
codeblock.precinctNumber = precinctNumber; codeblock.precinctNumber = precinctNumber;
codeblock.subbandType = subband.type; codeblock.subbandType = subband.type;
codeblock.Lblock = 3; codeblock.Lblock = 3;
@ -41907,6 +41924,7 @@ var JpxImage = (function JpxImageClosure() {
resolution.try0 = Math.ceil(component.tcy0 / scale); resolution.try0 = Math.ceil(component.tcy0 / scale);
resolution.trx1 = Math.ceil(component.tcx1 / scale); resolution.trx1 = Math.ceil(component.tcx1 / scale);
resolution.try1 = Math.ceil(component.tcy1 / scale); resolution.try1 = Math.ceil(component.tcy1 / scale);
resolution.resLevel = r;
buildPrecincts(context, resolution, blocksDimensions); buildPrecincts(context, resolution, blocksDimensions);
resolutions.push(resolution); resolutions.push(resolution);

4
build/pdf.js

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.954'; PDFJS.version = '1.0.956';
PDFJS.build = '8e6b97e'; PDFJS.build = 'de98380';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it

52
build/pdf.worker.js vendored

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.954'; PDFJS.version = '1.0.956';
PDFJS.build = '8e6b97e'; PDFJS.build = 'de98380';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
@ -35559,6 +35559,23 @@ var JpxImage = (function JpxImageClosure() {
// Section B.6 Division resolution to precincts // Section B.6 Division resolution to precincts
var precinctWidth = 1 << dimensions.PPx; var precinctWidth = 1 << dimensions.PPx;
var precinctHeight = 1 << dimensions.PPy; var precinctHeight = 1 << dimensions.PPy;
// Jasper introduces codeblock groups for mapping each subband codeblocks
// to precincts. Precinct partition divides a resolution according to width
// and height parameters. The subband that belongs to the resolution level
// has a different size than the level, unless it is the zero resolution.
// From Jasper documentation: jpeg2000.pdf, section K: Tier-2 coding:
// The precinct partitioning for a particular subband is derived from a
// partitioning of its parent LL band (i.e., the LL band at the next higher
// resolution level)... The LL band associated with each resolution level is
// divided into precincts... Each of the resulting precinct regions is then
// mapped into its child subbands (if any) at the next lower resolution
// level. This is accomplished by using the coordinate transformation
// (u, v) = (ceil(x/2), ceil(y/2)) where (x, y) and (u, v) are the
// coordinates of a point in the LL band and child subband, respectively.
var isZeroRes = resolution.resLevel === 0;
var precinctWidthInSubband = 1 << (dimensions.PPx + (isZeroRes ? 0 : -1));
var precinctHeightInSubband = 1 << (dimensions.PPy + (isZeroRes ? 0 : -1));
var numprecinctswide = (resolution.trx1 > resolution.trx0 ? var numprecinctswide = (resolution.trx1 > resolution.trx0 ?
Math.ceil(resolution.trx1 / precinctWidth) - Math.ceil(resolution.trx1 / precinctWidth) -
Math.floor(resolution.trx0 / precinctWidth) : 0); Math.floor(resolution.trx0 / precinctWidth) : 0);
@ -35566,18 +35583,15 @@ var JpxImage = (function JpxImageClosure() {
Math.ceil(resolution.try1 / precinctHeight) - Math.ceil(resolution.try1 / precinctHeight) -
Math.floor(resolution.try0 / precinctHeight) : 0); Math.floor(resolution.try0 / precinctHeight) : 0);
var numprecincts = numprecinctswide * numprecinctshigh; var numprecincts = numprecinctswide * numprecinctshigh;
var precinctXOffset = Math.floor(resolution.trx0 / precinctWidth) *
precinctWidth;
var precinctYOffset = Math.floor(resolution.try0 / precinctHeight) *
precinctHeight;
resolution.precinctParameters = { resolution.precinctParameters = {
precinctXOffset: precinctXOffset,
precinctYOffset: precinctYOffset,
precinctWidth: precinctWidth, precinctWidth: precinctWidth,
precinctHeight: precinctHeight, precinctHeight: precinctHeight,
numprecinctswide: numprecinctswide, numprecinctswide: numprecinctswide,
numprecinctshigh: numprecinctshigh, numprecinctshigh: numprecinctshigh,
numprecincts: numprecincts numprecincts: numprecincts,
precinctWidthInSubband: precinctWidthInSubband,
precinctHeightInSubband: precinctHeightInSubband
}; };
} }
function buildCodeblocks(context, subband, dimensions) { function buildCodeblocks(context, subband, dimensions) {
@ -35604,18 +35618,21 @@ var JpxImage = (function JpxImageClosure() {
tbx1: codeblockWidth * (i + 1), tbx1: codeblockWidth * (i + 1),
tby1: codeblockHeight * (j + 1) tby1: codeblockHeight * (j + 1)
}; };
// calculate precinct number
var pi = Math.floor((codeblock.tbx0 -
precinctParameters.precinctXOffset) /
precinctParameters.precinctWidth);
var pj = Math.floor((codeblock.tby0 -
precinctParameters.precinctYOffset) /
precinctParameters.precinctHeight);
precinctNumber = pj + pi * precinctParameters.numprecinctswide;
codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0); codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0);
codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0); codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0);
codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1); codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1);
codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1); codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1);
// Calculate precinct number for this codeblock, codeblock position
// should be relative to its subband, use actual dimension and position
// See comment about codeblock group width and height
var pi = Math.floor((codeblock.tbx0_ - subband.tbx0) /
precinctParameters.precinctWidthInSubband);
var pj = Math.floor((codeblock.tby0_ - subband.tby0) /
precinctParameters.precinctHeightInSubband);
precinctNumber = pi + (pj * precinctParameters.numprecinctswide);
codeblock.precinctNumber = precinctNumber; codeblock.precinctNumber = precinctNumber;
codeblock.subbandType = subband.type; codeblock.subbandType = subband.type;
codeblock.Lblock = 3; codeblock.Lblock = 3;
@ -35780,6 +35797,7 @@ var JpxImage = (function JpxImageClosure() {
resolution.try0 = Math.ceil(component.tcy0 / scale); resolution.try0 = Math.ceil(component.tcy0 / scale);
resolution.trx1 = Math.ceil(component.tcx1 / scale); resolution.trx1 = Math.ceil(component.tcx1 / scale);
resolution.try1 = Math.ceil(component.tcy1 / scale); resolution.try1 = Math.ceil(component.tcy1 / scale);
resolution.resLevel = r;
buildPrecincts(context, resolution, blocksDimensions); buildPrecincts(context, resolution, blocksDimensions);
resolutions.push(resolution); resolutions.push(resolution);

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.0.954", "version": "1.0.956",
"description": "Generic build of Mozilla's PDF.js library.", "description": "Generic build of Mozilla's PDF.js library.",
"keywords": [ "keywords": [
"Mozilla", "Mozilla",

Loading…
Cancel
Save