Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/embedpre.../assets/pdf/web
File: viewer.js
appConfig.secondaryToolbar?.printButton.classList.add("hidden");
[16500] Fix | Delete
}
[16501] Fix | Delete
if (!this.supportsFullscreen) {
[16502] Fix | Delete
appConfig.secondaryToolbar?.presentationModeButton.classList.add("hidden");
[16503] Fix | Delete
}
[16504] Fix | Delete
if (this.supportsIntegratedFind) {
[16505] Fix | Delete
appConfig.toolbar?.viewFind?.classList.add("hidden");
[16506] Fix | Delete
}
[16507] Fix | Delete
if (file) {
[16508] Fix | Delete
this.open({
[16509] Fix | Delete
url: file
[16510] Fix | Delete
});
[16511] Fix | Delete
} else {
[16512] Fix | Delete
this._hideViewBookmark();
[16513] Fix | Delete
}
[16514] Fix | Delete
},
[16515] Fix | Delete
get externalServices() {
[16516] Fix | Delete
return shadow(this, "externalServices", new ExternalServices());
[16517] Fix | Delete
},
[16518] Fix | Delete
get mlManager() {
[16519] Fix | Delete
return shadow(this, "mlManager", AppOptions.get("enableML") === true ? new MLManager() : null);
[16520] Fix | Delete
},
[16521] Fix | Delete
get initialized() {
[16522] Fix | Delete
return this._initializedCapability.settled;
[16523] Fix | Delete
},
[16524] Fix | Delete
get initializedPromise() {
[16525] Fix | Delete
return this._initializedCapability.promise;
[16526] Fix | Delete
},
[16527] Fix | Delete
updateZoom(steps, scaleFactor, origin) {
[16528] Fix | Delete
if (this.pdfViewer.isInPresentationMode) {
[16529] Fix | Delete
return;
[16530] Fix | Delete
}
[16531] Fix | Delete
this.pdfViewer.updateScale({
[16532] Fix | Delete
drawingDelay: AppOptions.get("defaultZoomDelay"),
[16533] Fix | Delete
steps,
[16534] Fix | Delete
scaleFactor,
[16535] Fix | Delete
origin
[16536] Fix | Delete
});
[16537] Fix | Delete
},
[16538] Fix | Delete
zoomIn() {
[16539] Fix | Delete
this.updateZoom(1);
[16540] Fix | Delete
},
[16541] Fix | Delete
zoomOut() {
[16542] Fix | Delete
this.updateZoom(-1);
[16543] Fix | Delete
},
[16544] Fix | Delete
zoomReset() {
[16545] Fix | Delete
if (this.pdfViewer.isInPresentationMode) {
[16546] Fix | Delete
return;
[16547] Fix | Delete
}
[16548] Fix | Delete
this.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE;
[16549] Fix | Delete
},
[16550] Fix | Delete
get pagesCount() {
[16551] Fix | Delete
return this.pdfDocument ? this.pdfDocument.numPages : 0;
[16552] Fix | Delete
},
[16553] Fix | Delete
get page() {
[16554] Fix | Delete
return this.pdfViewer.currentPageNumber;
[16555] Fix | Delete
},
[16556] Fix | Delete
set page(val) {
[16557] Fix | Delete
this.pdfViewer.currentPageNumber = val;
[16558] Fix | Delete
},
[16559] Fix | Delete
get supportsPrinting() {
[16560] Fix | Delete
return PDFPrintServiceFactory.supportsPrinting;
[16561] Fix | Delete
},
[16562] Fix | Delete
get supportsFullscreen() {
[16563] Fix | Delete
return shadow(this, "supportsFullscreen", document.fullscreenEnabled);
[16564] Fix | Delete
},
[16565] Fix | Delete
get supportsPinchToZoom() {
[16566] Fix | Delete
return shadow(this, "supportsPinchToZoom", AppOptions.get("supportsPinchToZoom"));
[16567] Fix | Delete
},
[16568] Fix | Delete
get supportsIntegratedFind() {
[16569] Fix | Delete
return shadow(this, "supportsIntegratedFind", AppOptions.get("supportsIntegratedFind"));
[16570] Fix | Delete
},
[16571] Fix | Delete
get loadingBar() {
[16572] Fix | Delete
const barElement = document.getElementById("loadingBar");
[16573] Fix | Delete
const bar = barElement ? new ProgressBar(barElement) : null;
[16574] Fix | Delete
return shadow(this, "loadingBar", bar);
[16575] Fix | Delete
},
[16576] Fix | Delete
get supportsMouseWheelZoomCtrlKey() {
[16577] Fix | Delete
return shadow(this, "supportsMouseWheelZoomCtrlKey", AppOptions.get("supportsMouseWheelZoomCtrlKey"));
[16578] Fix | Delete
},
[16579] Fix | Delete
get supportsMouseWheelZoomMetaKey() {
[16580] Fix | Delete
return shadow(this, "supportsMouseWheelZoomMetaKey", AppOptions.get("supportsMouseWheelZoomMetaKey"));
[16581] Fix | Delete
},
[16582] Fix | Delete
get supportsCaretBrowsingMode() {
[16583] Fix | Delete
return AppOptions.get("supportsCaretBrowsingMode");
[16584] Fix | Delete
},
[16585] Fix | Delete
moveCaret(isUp, select) {
[16586] Fix | Delete
this._caretBrowsing ||= new CaretBrowsingMode(this.appConfig.mainContainer, this.appConfig.viewerContainer, this.appConfig.toolbar?.container);
[16587] Fix | Delete
this._caretBrowsing.moveCaret(isUp, select);
[16588] Fix | Delete
},
[16589] Fix | Delete
setTitleUsingUrl(url = "", downloadUrl = null) {
[16590] Fix | Delete
this.url = url;
[16591] Fix | Delete
this.baseUrl = url.split("#", 1)[0];
[16592] Fix | Delete
if (downloadUrl) {
[16593] Fix | Delete
this._downloadUrl = downloadUrl === url ? this.baseUrl : downloadUrl.split("#", 1)[0];
[16594] Fix | Delete
}
[16595] Fix | Delete
if (isDataScheme(url)) {
[16596] Fix | Delete
this._hideViewBookmark();
[16597] Fix | Delete
}
[16598] Fix | Delete
let title = pdfjs_getPdfFilenameFromUrl(url, "");
[16599] Fix | Delete
if (!title) {
[16600] Fix | Delete
try {
[16601] Fix | Delete
title = decodeURIComponent(getFilenameFromUrl(url)) || url;
[16602] Fix | Delete
} catch {
[16603] Fix | Delete
title = url;
[16604] Fix | Delete
}
[16605] Fix | Delete
}
[16606] Fix | Delete
this.setTitle(title);
[16607] Fix | Delete
},
[16608] Fix | Delete
setTitle(title = this._title) {
[16609] Fix | Delete
this._title = title;
[16610] Fix | Delete
if (this.isViewerEmbedded) {
[16611] Fix | Delete
return;
[16612] Fix | Delete
}
[16613] Fix | Delete
const editorIndicator = this._hasAnnotationEditors && !this.pdfRenderingQueue.printing;
[16614] Fix | Delete
document.title = `${editorIndicator ? "* " : ""}${title}`;
[16615] Fix | Delete
},
[16616] Fix | Delete
get _docFilename() {
[16617] Fix | Delete
return this._contentDispositionFilename || pdfjs_getPdfFilenameFromUrl(this.url);
[16618] Fix | Delete
},
[16619] Fix | Delete
_hideViewBookmark() {
[16620] Fix | Delete
const {
[16621] Fix | Delete
secondaryToolbar
[16622] Fix | Delete
} = this.appConfig;
[16623] Fix | Delete
secondaryToolbar?.viewBookmarkButton.classList.add("hidden");
[16624] Fix | Delete
if (secondaryToolbar?.presentationModeButton.classList.contains("hidden")) {
[16625] Fix | Delete
document.getElementById("viewBookmarkSeparator")?.classList.add("hidden");
[16626] Fix | Delete
}
[16627] Fix | Delete
},
[16628] Fix | Delete
async close() {
[16629] Fix | Delete
this._unblockDocumentLoadEvent();
[16630] Fix | Delete
this._hideViewBookmark();
[16631] Fix | Delete
if (!this.pdfLoadingTask) {
[16632] Fix | Delete
return;
[16633] Fix | Delete
}
[16634] Fix | Delete
if (this.pdfDocument?.annotationStorage.size > 0 && this._annotationStorageModified) {
[16635] Fix | Delete
try {
[16636] Fix | Delete
await this.save();
[16637] Fix | Delete
} catch {}
[16638] Fix | Delete
}
[16639] Fix | Delete
const promises = [];
[16640] Fix | Delete
promises.push(this.pdfLoadingTask.destroy());
[16641] Fix | Delete
this.pdfLoadingTask = null;
[16642] Fix | Delete
if (this.pdfDocument) {
[16643] Fix | Delete
this.pdfDocument = null;
[16644] Fix | Delete
this.pdfThumbnailViewer?.setDocument(null);
[16645] Fix | Delete
this.pdfViewer.setDocument(null);
[16646] Fix | Delete
this.pdfLinkService.setDocument(null);
[16647] Fix | Delete
this.pdfDocumentProperties?.setDocument(null);
[16648] Fix | Delete
}
[16649] Fix | Delete
this.pdfLinkService.externalLinkEnabled = true;
[16650] Fix | Delete
this.store = null;
[16651] Fix | Delete
this.isInitialViewSet = false;
[16652] Fix | Delete
this.downloadComplete = false;
[16653] Fix | Delete
this.url = "";
[16654] Fix | Delete
this.baseUrl = "";
[16655] Fix | Delete
this._downloadUrl = "";
[16656] Fix | Delete
this.documentInfo = null;
[16657] Fix | Delete
this.metadata = null;
[16658] Fix | Delete
this._contentDispositionFilename = null;
[16659] Fix | Delete
this._contentLength = null;
[16660] Fix | Delete
this._saveInProgress = false;
[16661] Fix | Delete
this._hasAnnotationEditors = false;
[16662] Fix | Delete
promises.push(this.pdfScriptingManager.destroyPromise, this.passwordPrompt.close());
[16663] Fix | Delete
this.setTitle();
[16664] Fix | Delete
this.pdfSidebar?.reset();
[16665] Fix | Delete
this.pdfOutlineViewer?.reset();
[16666] Fix | Delete
this.pdfAttachmentViewer?.reset();
[16667] Fix | Delete
this.pdfLayerViewer?.reset();
[16668] Fix | Delete
this.pdfHistory?.reset();
[16669] Fix | Delete
this.findBar?.reset();
[16670] Fix | Delete
this.toolbar?.reset();
[16671] Fix | Delete
this.secondaryToolbar?.reset();
[16672] Fix | Delete
this._PDFBug?.cleanup();
[16673] Fix | Delete
await Promise.all(promises);
[16674] Fix | Delete
},
[16675] Fix | Delete
async open(args) {
[16676] Fix | Delete
if (this.pdfLoadingTask) {
[16677] Fix | Delete
await this.close();
[16678] Fix | Delete
}
[16679] Fix | Delete
const workerParams = AppOptions.getAll(OptionKind.WORKER);
[16680] Fix | Delete
Object.assign(GlobalWorkerOptions, workerParams);
[16681] Fix | Delete
if (args.url) {
[16682] Fix | Delete
this.setTitleUsingUrl(args.originalUrl || args.url, args.url);
[16683] Fix | Delete
}
[16684] Fix | Delete
const apiParams = AppOptions.getAll(OptionKind.API);
[16685] Fix | Delete
const loadingTask = getDocument({
[16686] Fix | Delete
...apiParams,
[16687] Fix | Delete
...args
[16688] Fix | Delete
});
[16689] Fix | Delete
this.pdfLoadingTask = loadingTask;
[16690] Fix | Delete
loadingTask.onPassword = (updateCallback, reason) => {
[16691] Fix | Delete
if (this.isViewerEmbedded) {
[16692] Fix | Delete
this._unblockDocumentLoadEvent();
[16693] Fix | Delete
}
[16694] Fix | Delete
this.pdfLinkService.externalLinkEnabled = false;
[16695] Fix | Delete
this.passwordPrompt.setUpdateCallback(updateCallback, reason);
[16696] Fix | Delete
this.passwordPrompt.open();
[16697] Fix | Delete
};
[16698] Fix | Delete
loadingTask.onProgress = ({
[16699] Fix | Delete
loaded,
[16700] Fix | Delete
total
[16701] Fix | Delete
}) => {
[16702] Fix | Delete
this.progress(loaded / total);
[16703] Fix | Delete
};
[16704] Fix | Delete
return loadingTask.promise.then(pdfDocument => {
[16705] Fix | Delete
this.load(pdfDocument);
[16706] Fix | Delete
}, reason => {
[16707] Fix | Delete
if (loadingTask !== this.pdfLoadingTask) {
[16708] Fix | Delete
return undefined;
[16709] Fix | Delete
}
[16710] Fix | Delete
let key = "pdfjs-loading-error";
[16711] Fix | Delete
if (reason instanceof InvalidPDFException) {
[16712] Fix | Delete
key = "pdfjs-invalid-file-error";
[16713] Fix | Delete
} else if (reason instanceof MissingPDFException) {
[16714] Fix | Delete
key = "pdfjs-missing-file-error";
[16715] Fix | Delete
} else if (reason instanceof UnexpectedResponseException) {
[16716] Fix | Delete
key = "pdfjs-unexpected-response-error";
[16717] Fix | Delete
}
[16718] Fix | Delete
return this._documentError(key, {
[16719] Fix | Delete
message: reason.message
[16720] Fix | Delete
}).then(() => {
[16721] Fix | Delete
throw reason;
[16722] Fix | Delete
});
[16723] Fix | Delete
});
[16724] Fix | Delete
},
[16725] Fix | Delete
_ensureDownloadComplete() {
[16726] Fix | Delete
if (this.pdfDocument && this.downloadComplete) {
[16727] Fix | Delete
return;
[16728] Fix | Delete
}
[16729] Fix | Delete
throw new Error("PDF document not downloaded.");
[16730] Fix | Delete
},
[16731] Fix | Delete
async download(options = {}) {
[16732] Fix | Delete
if (location.hash) {
[16733] Fix | Delete
let hash = location.hash;
[16734] Fix | Delete
let hashParams = new URLSearchParams(hash.substring(1));
[16735] Fix | Delete
[16736] Fix | Delete
if(hashParams.get('key') !== null) {
[16737] Fix | Delete
hashParams = '#' + atob(hashParams.get('key'));
[16738] Fix | Delete
hashParams = new URLSearchParams(hashParams.substring(1));
[16739] Fix | Delete
}
[16740] Fix | Delete
[16741] Fix | Delete
const element = document.querySelector('#download');
[16742] Fix | Delete
if((hashParams.get('download') === 'false' || hashParams.get('download') === '') || element.offsetParent === null){
[16743] Fix | Delete
return false;
[16744] Fix | Delete
}
[16745] Fix | Delete
} // added by EP developer
[16746] Fix | Delete
[16747] Fix | Delete
const url = this._downloadUrl,
[16748] Fix | Delete
filename = this._docFilename;
[16749] Fix | Delete
try {
[16750] Fix | Delete
this._ensureDownloadComplete();
[16751] Fix | Delete
const data = await this.pdfDocument.getData();
[16752] Fix | Delete
const blob = new Blob([data], {
[16753] Fix | Delete
type: "application/pdf"
[16754] Fix | Delete
});
[16755] Fix | Delete
await this.downloadManager.download(blob, url, filename, options);
[16756] Fix | Delete
} catch {
[16757] Fix | Delete
await this.downloadManager.downloadUrl(url, filename, options);
[16758] Fix | Delete
}
[16759] Fix | Delete
},
[16760] Fix | Delete
async save(options = {}) {
[16761] Fix | Delete
if (location.hash) {
[16762] Fix | Delete
let hash = location.hash;
[16763] Fix | Delete
let hashParams = new URLSearchParams(hash.substring(1));
[16764] Fix | Delete
[16765] Fix | Delete
if(hashParams.get('key') !== null) {
[16766] Fix | Delete
hashParams = '#' + atob(hashParams.get('key'));
[16767] Fix | Delete
hashParams = new URLSearchParams(hashParams.substring(1));
[16768] Fix | Delete
}
[16769] Fix | Delete
else{
[16770] Fix | Delete
return false;
[16771] Fix | Delete
}
[16772] Fix | Delete
[16773] Fix | Delete
const element = document.querySelector('#download');
[16774] Fix | Delete
[16775] Fix | Delete
if((hashParams.get('download') === 'false' || hashParams.get('download') === '') || element.offsetParent === null){
[16776] Fix | Delete
return false;
[16777] Fix | Delete
}
[16778] Fix | Delete
}// added by EP developer
[16779] Fix | Delete
[16780] Fix | Delete
if (this._saveInProgress) {
[16781] Fix | Delete
return;
[16782] Fix | Delete
}
[16783] Fix | Delete
this._saveInProgress = true;
[16784] Fix | Delete
await this.pdfScriptingManager.dispatchWillSave();
[16785] Fix | Delete
const url = this._downloadUrl,
[16786] Fix | Delete
filename = this._docFilename;
[16787] Fix | Delete
try {
[16788] Fix | Delete
this._ensureDownloadComplete();
[16789] Fix | Delete
const data = await this.pdfDocument.saveDocument();
[16790] Fix | Delete
const blob = new Blob([data], {
[16791] Fix | Delete
type: "application/pdf"
[16792] Fix | Delete
});
[16793] Fix | Delete
await this.downloadManager.download(blob, url, filename, options);
[16794] Fix | Delete
} catch (reason) {
[16795] Fix | Delete
console.error(`Error when saving the document: ${reason.message}`);
[16796] Fix | Delete
await this.download(options);
[16797] Fix | Delete
} finally {
[16798] Fix | Delete
await this.pdfScriptingManager.dispatchDidSave();
[16799] Fix | Delete
this._saveInProgress = false;
[16800] Fix | Delete
}
[16801] Fix | Delete
if (this._hasAnnotationEditors) {
[16802] Fix | Delete
this.externalServices.reportTelemetry({
[16803] Fix | Delete
type: "editing",
[16804] Fix | Delete
data: {
[16805] Fix | Delete
type: "save",
[16806] Fix | Delete
stats: this.pdfDocument?.annotationStorage.editorStats
[16807] Fix | Delete
}
[16808] Fix | Delete
});
[16809] Fix | Delete
}
[16810] Fix | Delete
},
[16811] Fix | Delete
downloadOrSave(options = {}) {
[16812] Fix | Delete
if (this.pdfDocument?.annotationStorage.size > 0) {
[16813] Fix | Delete
this.save(options);
[16814] Fix | Delete
} else {
[16815] Fix | Delete
this.download(options);
[16816] Fix | Delete
}
[16817] Fix | Delete
},
[16818] Fix | Delete
async _documentError(key, moreInfo = null) {
[16819] Fix | Delete
this._unblockDocumentLoadEvent();
[16820] Fix | Delete
const message = await this._otherError(key || "pdfjs-loading-error", moreInfo);
[16821] Fix | Delete
this.eventBus.dispatch("documenterror", {
[16822] Fix | Delete
source: this,
[16823] Fix | Delete
message,
[16824] Fix | Delete
reason: moreInfo?.message ?? null
[16825] Fix | Delete
});
[16826] Fix | Delete
},
[16827] Fix | Delete
async _otherError(key, moreInfo = null) {
[16828] Fix | Delete
const message = await this.l10n.get(key);
[16829] Fix | Delete
const moreInfoText = [`PDF.js v${version || "?"} (build: ${build || "?"})`];
[16830] Fix | Delete
if (moreInfo) {
[16831] Fix | Delete
moreInfoText.push(`Message: ${moreInfo.message}`);
[16832] Fix | Delete
if (moreInfo.stack) {
[16833] Fix | Delete
moreInfoText.push(`Stack: ${moreInfo.stack}`);
[16834] Fix | Delete
} else {
[16835] Fix | Delete
if (moreInfo.filename) {
[16836] Fix | Delete
moreInfoText.push(`File: ${moreInfo.filename}`);
[16837] Fix | Delete
}
[16838] Fix | Delete
if (moreInfo.lineNumber) {
[16839] Fix | Delete
moreInfoText.push(`Line: ${moreInfo.lineNumber}`);
[16840] Fix | Delete
}
[16841] Fix | Delete
}
[16842] Fix | Delete
}
[16843] Fix | Delete
console.error(`${message}\n\n${moreInfoText.join("\n")}`);
[16844] Fix | Delete
return message;
[16845] Fix | Delete
},
[16846] Fix | Delete
progress(level) {
[16847] Fix | Delete
if (!this.loadingBar || this.downloadComplete) {
[16848] Fix | Delete
return;
[16849] Fix | Delete
}
[16850] Fix | Delete
const percent = Math.round(level * 100);
[16851] Fix | Delete
if (percent <= this.loadingBar.percent) {
[16852] Fix | Delete
return;
[16853] Fix | Delete
}
[16854] Fix | Delete
this.loadingBar.percent = percent;
[16855] Fix | Delete
if (this.pdfDocument?.loadingParams.disableAutoFetch ?? AppOptions.get("disableAutoFetch")) {
[16856] Fix | Delete
this.loadingBar.setDisableAutoFetch();
[16857] Fix | Delete
}
[16858] Fix | Delete
},
[16859] Fix | Delete
load(pdfDocument) {
[16860] Fix | Delete
this.pdfDocument = pdfDocument;
[16861] Fix | Delete
pdfDocument.getDownloadInfo().then(({
[16862] Fix | Delete
length
[16863] Fix | Delete
}) => {
[16864] Fix | Delete
this._contentLength = length;
[16865] Fix | Delete
this.downloadComplete = true;
[16866] Fix | Delete
this.loadingBar?.hide();
[16867] Fix | Delete
firstPagePromise.then(() => {
[16868] Fix | Delete
this.eventBus.dispatch("documentloaded", {
[16869] Fix | Delete
source: this
[16870] Fix | Delete
});
[16871] Fix | Delete
});
[16872] Fix | Delete
});
[16873] Fix | Delete
const pageLayoutPromise = pdfDocument.getPageLayout().catch(() => {});
[16874] Fix | Delete
const pageModePromise = pdfDocument.getPageMode().catch(() => {});
[16875] Fix | Delete
const openActionPromise = pdfDocument.getOpenAction().catch(() => {});
[16876] Fix | Delete
this.toolbar?.setPagesCount(pdfDocument.numPages, false);
[16877] Fix | Delete
this.secondaryToolbar?.setPagesCount(pdfDocument.numPages);
[16878] Fix | Delete
this.pdfLinkService.setDocument(pdfDocument);
[16879] Fix | Delete
this.pdfDocumentProperties?.setDocument(pdfDocument);
[16880] Fix | Delete
const pdfViewer = this.pdfViewer;
[16881] Fix | Delete
pdfViewer.setDocument(pdfDocument);
[16882] Fix | Delete
const {
[16883] Fix | Delete
firstPagePromise,
[16884] Fix | Delete
onePageRendered,
[16885] Fix | Delete
pagesPromise
[16886] Fix | Delete
} = pdfViewer;
[16887] Fix | Delete
this.pdfThumbnailViewer?.setDocument(pdfDocument);
[16888] Fix | Delete
const storedPromise = (this.store = new ViewHistory(pdfDocument.fingerprints[0])).getMultiple({
[16889] Fix | Delete
page: null,
[16890] Fix | Delete
zoom: DEFAULT_SCALE_VALUE,
[16891] Fix | Delete
scrollLeft: "0",
[16892] Fix | Delete
scrollTop: "0",
[16893] Fix | Delete
rotation: null,
[16894] Fix | Delete
sidebarView: SidebarView.UNKNOWN,
[16895] Fix | Delete
scrollMode: ScrollMode.UNKNOWN,
[16896] Fix | Delete
spreadMode: SpreadMode.UNKNOWN
[16897] Fix | Delete
}).catch(() => {});
[16898] Fix | Delete
firstPagePromise.then(pdfPage => {
[16899] Fix | Delete
this.loadingBar?.setWidth(this.appConfig.viewerContainer);
[16900] Fix | Delete
this._initializeAnnotationStorageCallbacks(pdfDocument);
[16901] Fix | Delete
Promise.all([animationStarted, storedPromise, pageLayoutPromise, pageModePromise, openActionPromise]).then(async ([timeStamp, stored, pageLayout, pageMode, openAction]) => {
[16902] Fix | Delete
const viewOnLoad = AppOptions.get("viewOnLoad");
[16903] Fix | Delete
this._initializePdfHistory({
[16904] Fix | Delete
fingerprint: pdfDocument.fingerprints[0],
[16905] Fix | Delete
viewOnLoad,
[16906] Fix | Delete
initialDest: openAction?.dest
[16907] Fix | Delete
});
[16908] Fix | Delete
const initialBookmark = this.initialBookmark;
[16909] Fix | Delete
const zoom = AppOptions.get("defaultZoomValue");
[16910] Fix | Delete
let hash = zoom ? `zoom=${zoom}` : null;
[16911] Fix | Delete
let rotation = null;
[16912] Fix | Delete
let sidebarView = AppOptions.get("sidebarViewOnLoad");
[16913] Fix | Delete
let scrollMode = AppOptions.get("scrollModeOnLoad");
[16914] Fix | Delete
let spreadMode = AppOptions.get("spreadModeOnLoad");
[16915] Fix | Delete
if (stored?.page && viewOnLoad !== ViewOnLoad.INITIAL) {
[16916] Fix | Delete
hash = `page=${stored.page}&zoom=${zoom || stored.zoom},` + `${stored.scrollLeft},${stored.scrollTop}`;
[16917] Fix | Delete
rotation = parseInt(stored.rotation, 10);
[16918] Fix | Delete
if (sidebarView === SidebarView.UNKNOWN) {
[16919] Fix | Delete
sidebarView = stored.sidebarView | 0;
[16920] Fix | Delete
}
[16921] Fix | Delete
if (scrollMode === ScrollMode.UNKNOWN) {
[16922] Fix | Delete
scrollMode = stored.scrollMode | 0;
[16923] Fix | Delete
}
[16924] Fix | Delete
if (spreadMode === SpreadMode.UNKNOWN) {
[16925] Fix | Delete
spreadMode = stored.spreadMode | 0;
[16926] Fix | Delete
}
[16927] Fix | Delete
}
[16928] Fix | Delete
if (pageMode && sidebarView === SidebarView.UNKNOWN) {
[16929] Fix | Delete
sidebarView = apiPageModeToSidebarView(pageMode);
[16930] Fix | Delete
}
[16931] Fix | Delete
if (pageLayout && scrollMode === ScrollMode.UNKNOWN && spreadMode === SpreadMode.UNKNOWN) {
[16932] Fix | Delete
const modes = apiPageLayoutToViewerModes(pageLayout);
[16933] Fix | Delete
spreadMode = modes.spreadMode;
[16934] Fix | Delete
}
[16935] Fix | Delete
this.setInitialView(hash, {
[16936] Fix | Delete
rotation,
[16937] Fix | Delete
sidebarView,
[16938] Fix | Delete
scrollMode,
[16939] Fix | Delete
spreadMode
[16940] Fix | Delete
});
[16941] Fix | Delete
this.eventBus.dispatch("documentinit", {
[16942] Fix | Delete
source: this
[16943] Fix | Delete
});
[16944] Fix | Delete
if (!this.isViewerEmbedded) {
[16945] Fix | Delete
pdfViewer.focus();
[16946] Fix | Delete
}
[16947] Fix | Delete
await Promise.race([pagesPromise, new Promise(resolve => {
[16948] Fix | Delete
setTimeout(resolve, FORCE_PAGES_LOADED_TIMEOUT);
[16949] Fix | Delete
})]);
[16950] Fix | Delete
if (!initialBookmark && !hash) {
[16951] Fix | Delete
return;
[16952] Fix | Delete
}
[16953] Fix | Delete
if (pdfViewer.hasEqualPageSizes) {
[16954] Fix | Delete
return;
[16955] Fix | Delete
}
[16956] Fix | Delete
this.initialBookmark = initialBookmark;
[16957] Fix | Delete
pdfViewer.currentScaleValue = pdfViewer.currentScaleValue;
[16958] Fix | Delete
this.setInitialView(hash);
[16959] Fix | Delete
}).catch(() => {
[16960] Fix | Delete
this.setInitialView();
[16961] Fix | Delete
}).then(function () {
[16962] Fix | Delete
pdfViewer.update();
[16963] Fix | Delete
});
[16964] Fix | Delete
});
[16965] Fix | Delete
pagesPromise.then(() => {
[16966] Fix | Delete
this._unblockDocumentLoadEvent();
[16967] Fix | Delete
this._initializeAutoPrint(pdfDocument, openActionPromise);
[16968] Fix | Delete
}, reason => {
[16969] Fix | Delete
this._documentError("pdfjs-loading-error", {
[16970] Fix | Delete
message: reason.message
[16971] Fix | Delete
});
[16972] Fix | Delete
});
[16973] Fix | Delete
onePageRendered.then(data => {
[16974] Fix | Delete
this.externalServices.reportTelemetry({
[16975] Fix | Delete
type: "pageInfo",
[16976] Fix | Delete
timestamp: data.timestamp
[16977] Fix | Delete
});
[16978] Fix | Delete
if (this.pdfOutlineViewer) {
[16979] Fix | Delete
pdfDocument.getOutline().then(outline => {
[16980] Fix | Delete
if (pdfDocument !== this.pdfDocument) {
[16981] Fix | Delete
return;
[16982] Fix | Delete
}
[16983] Fix | Delete
this.pdfOutlineViewer.render({
[16984] Fix | Delete
outline,
[16985] Fix | Delete
pdfDocument
[16986] Fix | Delete
});
[16987] Fix | Delete
});
[16988] Fix | Delete
}
[16989] Fix | Delete
if (this.pdfAttachmentViewer) {
[16990] Fix | Delete
pdfDocument.getAttachments().then(attachments => {
[16991] Fix | Delete
if (pdfDocument !== this.pdfDocument) {
[16992] Fix | Delete
return;
[16993] Fix | Delete
}
[16994] Fix | Delete
this.pdfAttachmentViewer.render({
[16995] Fix | Delete
attachments
[16996] Fix | Delete
});
[16997] Fix | Delete
});
[16998] Fix | Delete
}
[16999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function