Skip to content

Commit

Permalink
Merge tag '2.0.550'
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacSchemm committed Jun 20, 2018
2 parents 6f6b2b8 + 76337fd commit 7d9e51f
Show file tree
Hide file tree
Showing 173 changed files with 15,283 additions and 995 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ Makefile
node_modules/
examples/node/svgdump/
examples/node/pdf2png/*.png
package-lock.json
10 changes: 2 additions & 8 deletions examples/node/pdf2png/pdf2png.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,8 @@ var pdfURL = '../../../web/compressed.tracemonkey-pldi-09.pdf';
// Read the PDF file into a typed array so PDF.js can load it.
var rawData = new Uint8Array(fs.readFileSync(pdfURL));

// Load the PDF file. The `disableFontFace` and `nativeImageDecoderSupport`
// options must be passed because Node.js has no native `@font-face` and
// `Image` support.
pdfjsLib.getDocument({
data: rawData,
disableFontFace: true,
nativeImageDecoderSupport: 'none',
}).then(function (pdfDocument) {
// Load the PDF file.
pdfjsLib.getDocument(rawData).then(function (pdfDocument) {
console.log('# PDF document loaded.');

// Get the first page.
Expand Down
14 changes: 7 additions & 7 deletions examples/webpack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ Example to demonstrate PDF.js library usage with Webpack.

## Getting started

Build project and install the example dependencies:
Install the example dependencies and build the project:

$ gulp dist-install
$ cd examples/webpack
$ npm install
$ ./node_modules/webpack/bin/webpack.js

To build Webpack bundles, run `node_modules/.bin/webpack`. If you are running
a web server, you can observe the build results at
http://localhost:8888/examples/webpack/index.html
You can observe the build results by running `gulp server` and navigating to
http://localhost:8888/examples/webpack/index.html.

See main.js and webpack.config.js files. Please notice that PDF.js
packaging requires packaging of the main application and PDF.js worker code,
and the `workerSrc` path shall be set to the latter file.
Refer to the `main.js` and `webpack.config.js` files for the source code.
Note that PDF.js packaging requires packaging of the main application and
the worker code, and the `workerSrc` path shall be set to the latter file.
3 changes: 2 additions & 1 deletion examples/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"build": "webpack"
},
"devDependencies": {
"webpack": "~1.12.9",
"webpack": "^4.10.2",
"webpack-cli": "^2.1.4",
"pdfjs-dist": "../../node_modules/pdfjs-dist"
}
}
11 changes: 2 additions & 9 deletions examples/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,10 @@ module.exports = {
'main': './main.js',
'pdf.worker': 'pdfjs-dist/build/pdf.worker.entry'
},
mode: 'none',
output: {
path: path.join(__dirname, '../../build/webpack'),
publicPath: '../../build/webpack/',
filename: '[name].bundle.js'
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compressor: {
screw_ie8: true,
warnings: false
}
})
]
}
};
2 changes: 1 addition & 1 deletion external/webpack/pdfjsdev-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function (source) {
this.cacheable();

var filePath = this.resourcePath;
var context = this.options.context;
var context = this.rootContext;
var sourcePath = path.relative(context, filePath).split(path.sep).join('/');

var ctx = Object.create(this.query);
Expand Down
45 changes: 18 additions & 27 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ var spawn = require('child_process').spawn;
var spawnSync = require('child_process').spawnSync;
var streamqueue = require('streamqueue');
var merge = require('merge-stream');
var zip = require('gulp-zip');
var webpack2 = require('webpack');
var zip = require('gulp-zip');var webpack2 = require('webpack');
var webpackStream = require('webpack-stream');
var Vinyl = require('vinyl');
var vfs = require('vinyl-fs');
Expand All @@ -52,7 +51,6 @@ var GENERIC_DIR = BUILD_DIR + 'generic/';
var COMPONENTS_DIR = BUILD_DIR + 'components/';
var MINIFIED_DIR = BUILD_DIR + 'minified/';
var SEAMONKEY_BUILD_DIR = BUILD_DIR + 'seamonkey/';
var CHROME_BUILD_DIR = BUILD_DIR + 'chromium/';
var JSDOC_BUILD_DIR = BUILD_DIR + 'jsdoc/';
var GH_PAGES_DIR = BUILD_DIR + 'gh-pages/';
var SRC_DIR = 'src/';
Expand Down Expand Up @@ -125,7 +123,7 @@ function createStringSource(filename, content) {
source._read = function () {
this.push(new Vinyl({
path: filename,
contents: new Buffer(content),
contents: Buffer.from(content),
}));
this.push(null);
};
Expand All @@ -147,8 +145,15 @@ function createWebpackConfig(defines, output) {
var skipBabel = bundleDefines.SKIP_BABEL ||
process.env['SKIP_BABEL'] === 'true';

// Required to expose e.g., the `window` object.
output.globalObject = 'this';

return {
mode: 'none',
output: output,
performance: {
hints: false, // Disable messages about larger file sizes.
},
plugins: [
new webpack2.BannerPlugin({ banner: licenseHeaderLibre, raw: true, }),
],
Expand All @@ -161,10 +166,11 @@ function createWebpackConfig(defines, output) {
},
devtool: enableSourceMaps ? 'source-map' : undefined,
module: {
loaders: [
rules: [
{
loader: 'babel-loader',
exclude: /src\/core\/(glyphlist|unicode)/, // babel is too slow
// babel is too slow
exclude: /src[\\\/]core[\\\/](glyphlist|unicode)/,
options: {
presets: skipBabel ? undefined : ['env'],
plugins: ['transform-es2015-modules-commonjs'],
Expand Down Expand Up @@ -423,8 +429,6 @@ gulp.task('default', function() {
});
});

gulp.task('extension', ['seamonkey', 'chromium']);

gulp.task('buildnumber', function (done) {
console.log();
console.log('### Getting extension build number');
Expand Down Expand Up @@ -1023,24 +1027,16 @@ gulp.task('lib', ['buildnumber'], function () {
var licenseHeaderLibre =
fs.readFileSync('./src/license_header_libre.js').toString();
var preprocessor2 = require('./external/builder/preprocessor2.js');
var sharedFiles = [
'compatibility',
'global_scope',
'is_node',
'streams_polyfill',
'util',
];
var buildLib = merge([
gulp.src([
'src/{core,display}/*.js',
'src/shared/{' + sharedFiles.join() + '}.js',
'src/{core,display,shared}/*.js',
'!src/shared/{cffStandardStrings,fonts_utils}.js',
'src/{pdf,pdf.worker}.js',
], { base: 'src/', }),
gulp.src([
'examples/node/domstubs.js',
'web/*.js',
'!web/pdfjs.js',
'!web/viewer.js',
'!web/{pdfjs,viewer}.js',
], { base: '.', }),
gulp.src('test/unit/*.js', { base: '.', }),
]).pipe(transform('utf8', preprocess))
Expand All @@ -1052,7 +1048,7 @@ gulp.task('lib', ['buildnumber'], function () {
]);
});

gulp.task('web-pre', ['generic', 'extension', 'jsdoc']);
gulp.task('web-pre', ['generic', 'jsdoc']);

gulp.task('publish', ['generic'], function (done) {
var version = JSON.parse(
Expand Down Expand Up @@ -1235,11 +1231,6 @@ gulp.task('gh-pages-prepare', ['web-pre'], function () {
return merge([
vfs.src(GENERIC_DIR + '**/*', { base: GENERIC_DIR, stripBOM: false, })
.pipe(gulp.dest(GH_PAGES_DIR)),
gulp.src([SEAMONKEY_BUILD_DIR + '*.xpi',
SEAMONKEY_BUILD_DIR + '*.rdf'])
.pipe(gulp.dest(GH_PAGES_DIR + EXTENSION_SRC_DIR + 'seamonkey/')),
gulp.src(CHROME_BUILD_DIR + '*.crx')
.pipe(gulp.dest(GH_PAGES_DIR + EXTENSION_SRC_DIR + 'chromium/')),
gulp.src('test/features/**/*', { base: 'test/', })
.pipe(gulp.dest(GH_PAGES_DIR)),
gulp.src(JSDOC_BUILD_DIR + '**/*', { base: JSDOC_BUILD_DIR, })
Expand Down Expand Up @@ -1315,10 +1306,10 @@ gulp.task('dist-pre', ['generic', 'components', 'lib', 'minified'], function() {
license: DIST_LICENSE,
dependencies: {
'node-ensure': '^0.0.0', // shim for node for require.ensure
'worker-loader': '^1.1.1', // used in external/dist/webpack.json
'worker-loader': '^2.0.0', // used in external/dist/webpack.json
},
peerDependencies: {
'webpack': '^2.0.0 || ^3.0.0', // peerDependency of 'worker-loader'
'webpack': '^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0', // from 'worker-loader'
},
browser: {
'fs': false,
Expand Down
17 changes: 17 additions & 0 deletions l10n/bg/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,23 @@ document_properties_creator=Създател:
document_properties_producer=PDF произведен от:
document_properties_version=Издание на PDF:
document_properties_page_count=Брой страници:
document_properties_page_size=Размер на страницата:
document_properties_page_size_unit_inches=инч
document_properties_page_size_unit_millimeters=мм
document_properties_page_size_orientation_portrait=портрет
document_properties_page_size_orientation_landscape=пейзаж
document_properties_page_size_name_a3=A3
document_properties_page_size_name_a4=A4
document_properties_page_size_name_letter=Letter
document_properties_page_size_name_legal=Legal
# LOCALIZATION NOTE (document_properties_page_size_dimension_string):
# "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement and orientation, of the (current) page.
document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}} ({{orientation}})
# LOCALIZATION NOTE (document_properties_page_size_dimension_name_string):
# "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement, name, and orientation, of the (current) page.
document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})
document_properties_close=Затваряне

print_progress_message=Подготвяне на документа за отпечатване…
Expand Down
17 changes: 17 additions & 0 deletions l10n/bs/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,23 @@ document_properties_creator=Kreator:
document_properties_producer=PDF stvaratelj:
document_properties_version=PDF verzija:
document_properties_page_count=Broj stranica:
document_properties_page_size=Veličina stranice:
document_properties_page_size_unit_inches=u
document_properties_page_size_unit_millimeters=mm
document_properties_page_size_orientation_portrait=uspravno
document_properties_page_size_orientation_landscape=vodoravno
document_properties_page_size_name_a3=A3
document_properties_page_size_name_a4=A4
document_properties_page_size_name_letter=Pismo
document_properties_page_size_name_legal=Pravni
# LOCALIZATION NOTE (document_properties_page_size_dimension_string):
# "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement and orientation, of the (current) page.
document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}} ({{orientation}})
# LOCALIZATION NOTE (document_properties_page_size_dimension_name_string):
# "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement, name, and orientation, of the (current) page.
document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})
document_properties_close=Zatvori

print_progress_message=Pripremam dokument za štampu…
Expand Down
17 changes: 17 additions & 0 deletions l10n/ca/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,23 @@ document_properties_creator=Creador:
document_properties_producer=Generador de PDF:
document_properties_version=Versió de PDF:
document_properties_page_count=Nombre de pàgines:
document_properties_page_size=Mida de la pàgina:
document_properties_page_size_unit_inches=polzades
document_properties_page_size_unit_millimeters=mm
document_properties_page_size_orientation_portrait=vertical
document_properties_page_size_orientation_landscape=apaïsat
document_properties_page_size_name_a3=A3
document_properties_page_size_name_a4=A4
document_properties_page_size_name_letter=Carta
document_properties_page_size_name_legal=Legal
# LOCALIZATION NOTE (document_properties_page_size_dimension_string):
# "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement and orientation, of the (current) page.
document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}} ({{orientation}})
# LOCALIZATION NOTE (document_properties_page_size_dimension_name_string):
# "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement, name, and orientation, of the (current) page.
document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})
document_properties_close=Tanca

print_progress_message=S'està preparant la impressió del document…
Expand Down
17 changes: 17 additions & 0 deletions l10n/da/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,23 @@ document_properties_creator=Program:
document_properties_producer=PDF-producent:
document_properties_version=PDF-version:
document_properties_page_count=Antal sider:
document_properties_page_size=Sidestørrelse:
document_properties_page_size_unit_inches=in
document_properties_page_size_unit_millimeters=mm
document_properties_page_size_orientation_portrait=stående
document_properties_page_size_orientation_landscape=liggende
document_properties_page_size_name_a3=A3
document_properties_page_size_name_a4=A4
document_properties_page_size_name_letter=Letter
document_properties_page_size_name_legal=Legal
# LOCALIZATION NOTE (document_properties_page_size_dimension_string):
# "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement and orientation, of the (current) page.
document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}} ({{orientation}})
# LOCALIZATION NOTE (document_properties_page_size_dimension_name_string):
# "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement, name, and orientation, of the (current) page.
document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})
document_properties_close=Luk

print_progress_message=Forbereder dokument til udskrivning…
Expand Down
2 changes: 1 addition & 1 deletion l10n/el/chrome.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@

# Chrome notification bar messages and buttons
unsupported_feature=Αυτό το έγγραφο PDF μπορεί να μην εμφανιστεί σωστά
unsupported_feature_forms=Αυτό το έγγραφο PDF περιέχει πεδία φόρμας. Το συμπλήρωμα πεδίων φόρμας δεν υποστιρίζεται.
unsupported_feature_forms=Αυτό το έγγραφο PDF περιέχει πεδία φόρμας. Το συμπλήρωμα πεδίων φόρμας δεν υποστηρίζεται.
open_with_different_viewer=Άνοιγμα με διαφορετική εφαρμογή
open_with_different_viewer.accessKey=δ
17 changes: 17 additions & 0 deletions l10n/eo/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,23 @@ document_properties_creator=Kreinto:
document_properties_producer=Produktinto de PDF:
document_properties_version=Versio de PDF:
document_properties_page_count=Nombro de paĝoj:
document_properties_page_size=Grando de paĝo:
document_properties_page_size_unit_inches=in
document_properties_page_size_unit_millimeters=mm
document_properties_page_size_orientation_portrait=vertikala
document_properties_page_size_orientation_landscape=horizontala
document_properties_page_size_name_a3=A3
document_properties_page_size_name_a4=A4
document_properties_page_size_name_letter=Letera
document_properties_page_size_name_legal=Jura
# LOCALIZATION NOTE (document_properties_page_size_dimension_string):
# "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement and orientation, of the (current) page.
document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}} ({{orientation}})
# LOCALIZATION NOTE (document_properties_page_size_dimension_name_string):
# "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement, name, and orientation, of the (current) page.
document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})
document_properties_close=Fermi

print_progress_message=Preparo de dokumento por presi ĝin …
Expand Down
17 changes: 17 additions & 0 deletions l10n/es-AR/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,23 @@ document_properties_creator=Creador:
document_properties_producer=PDF Productor:
document_properties_version=Versión de PDF:
document_properties_page_count=Cantidad de páginas:
document_properties_page_size=Tamaño de página:
document_properties_page_size_unit_inches=en
document_properties_page_size_unit_millimeters=mm
document_properties_page_size_orientation_portrait=normal
document_properties_page_size_orientation_landscape=apaisado
document_properties_page_size_name_a3=A3
document_properties_page_size_name_a4=A4
document_properties_page_size_name_letter=Carta
document_properties_page_size_name_legal=Legal
# LOCALIZATION NOTE (document_properties_page_size_dimension_string):
# "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement and orientation, of the (current) page.
document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}} ({{orientation}})
# LOCALIZATION NOTE (document_properties_page_size_dimension_name_string):
# "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement, name, and orientation, of the (current) page.
document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})
document_properties_close=Cerrar

print_progress_message=Preparando documento para imprimir…
Expand Down
Loading

0 comments on commit 7d9e51f

Please sign in to comment.