Skip to content

Commit 683ee88

Browse files
committed
Resolve merge conflict in 5.1.0-test branch
1 parent e7e0902 commit 683ee88

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/helpers/loadDocument.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -285,30 +285,21 @@ export const getDocumentExtension = docName => {
285285
extension = result && result[1].toLowerCase();
286286
}
287287

288-
if (extension) {
289-
if (!supportedExtensions.includes(extension)) {
290-
console.error(`File extension is not found or incorrect. Use "extension" option in PDFTron.WebViewer constructor and loadDocument if the extension is not known. See for more details ...`)
291-
console.error(`File extension ${extension} from ${doc} is not supported.\nWebViewer client only mode supports ${supportedClientOnlyExtensions.join(', ')}.\nWebViewer server supports ${supportedBlackboxExtensions.join(', ')}`);
292-
}
293-
} else if (doc && engineType === engineTypes.AUTO) {
294-
console.warn(`File extension cannot be determined from ${doc}. Falling back to pdf`);
295-
}
296-
297-
return extension ? extension : '';
288+
return extension;
298289
};
299290

300291
export const getDocName = state => {
301292
// if the filename is specified then use that for checking the extension instead of the doc path
302293
let { path, filename, initialDoc, ext } = state.document;
303294
if (ext && !filename) {
304-
filename = createFakeFilename(path || initialDoc, ext)
295+
filename = createFakeFilename(path || initialDoc, ext);
305296
}
306297
return filename || path || initialDoc;
307298
};
308299

309300
const createFakeFilename = (initialDoc, ext) => {
310-
return initialDoc.replace(/^.*[\\\/]/, '') + '.' + ext.replace(/^\./, "");
311-
}
301+
return initialDoc.replace(/^.*[\\\/]/, '') + '.' + ext.replace(/^\./, '');
302+
};
312303

313304
const isPDFNetJSExtension = extension => {
314305
return isOfficeExtension(extension) || isPDFExtension(extension);

0 commit comments

Comments
 (0)