1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

fix(svg) adjust strategy for decoding JPEG images

This commit is contained in:
巴里切罗 2017-05-08 11:32:44 +08:00
parent 0dbc68a6d6
commit 8d5d97264e
9 changed files with 66 additions and 15 deletions

View file

@ -39,14 +39,15 @@ function writeToFile(svgdump, pageNum) {
function getFileNameFromPath(path) {
var index = path.lastIndexOf('/');
var extIndex = path.lastIndexOf('.');
return path.substring(index , extIndex);
return path.substring(index, extIndex);
}
// Will be using promises to load document, pages and misc data instead of
// callback.
pdfjsLib.getDocument({
data: data,
disableNativeImageDecoder: true,
// Try to export JPEG images directly if they don't need any further processing.
nativeImageDecoderSupport: pdfjsLib.NativeImageDecoding.DISPLAY
}).then(function (doc) {
var numPages = doc.numPages;
console.log('# Document Loaded');