fixed ocr doc reload issue
This commit is contained in:
parent
e2fae352ce
commit
230d7814c0
@ -389,6 +389,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
async viewerReady($event: WebViewerInstance) {
|
||||
this._instance = $event;
|
||||
this.ready = true;
|
||||
|
||||
await this._stampPDF();
|
||||
await this._reloadAnnotations();
|
||||
this._setExcludedPageStyles();
|
||||
@ -410,6 +411,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
} else {
|
||||
this._loadingService.stop();
|
||||
}
|
||||
this._changeDetectorRef.markForCheck();
|
||||
}
|
||||
|
||||
async annotationsChangedByReviewAction(annotation: AnnotationWrapper) {
|
||||
@ -469,19 +471,25 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
if (!this._instance) {
|
||||
return;
|
||||
}
|
||||
|
||||
const document = this._instance.Core.documentViewer.getDocument();
|
||||
if (!document) {
|
||||
return;
|
||||
}
|
||||
|
||||
const pdfNet = this._instance.Core.PDFNet;
|
||||
const document = await this._instance.Core.documentViewer.getDocument().getPDFDoc();
|
||||
const pdfDoc = await this._instance.Core.documentViewer.getDocument().getPDFDoc();
|
||||
const file = this._filesMapService.get(this.dossierId, this.fileId);
|
||||
const allPages = [...Array(file.numberOfPages).keys()].map(page => page + 1);
|
||||
await clearStamps(document, pdfNet, allPages);
|
||||
await clearStamps(pdfDoc, pdfNet, allPages);
|
||||
|
||||
if (this.viewModeService.viewMode === 'REDACTED') {
|
||||
const dossier = this._dossiersService.find(this.dossierId);
|
||||
if (dossier.watermarkPreviewEnabled) {
|
||||
await this._stampPreview(document, dossier.dossierTemplateId);
|
||||
await this._stampPreview(pdfDoc, dossier.dossierTemplateId);
|
||||
}
|
||||
} else {
|
||||
await this._stampExcludedPages(document, file.excludedPages);
|
||||
await this._stampExcludedPages(pdfDoc, file.excludedPages);
|
||||
}
|
||||
this._instance.Core.documentViewer.refreshAll();
|
||||
this._instance.Core.documentViewer.updateView([this.activeViewerPage], this.activeViewerPage);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user