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:
parent
0dbc68a6d6
commit
8d5d97264e
9 changed files with 66 additions and 15 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue