Merge branch 'master' into VM/RED-6240
This commit is contained in:
commit
b33abddcc2
@ -1,7 +1,7 @@
|
|||||||
import { inject, Injectable } from '@angular/core';
|
import { inject, Injectable } from '@angular/core';
|
||||||
import { Core } from '@pdftron/webviewer';
|
import { Core } from '@pdftron/webviewer';
|
||||||
import { NGXLogger } from 'ngx-logger';
|
import { NGXLogger } from 'ngx-logger';
|
||||||
import { fromEvent, merge, Observable, Subject } from 'rxjs';
|
import { fromEvent, merge, Observable } from 'rxjs';
|
||||||
import { debounceTime, filter, map, tap } from 'rxjs/operators';
|
import { debounceTime, filter, map, tap } from 'rxjs/operators';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { PdfViewer } from './pdf-viewer.service';
|
import { PdfViewer } from './pdf-viewer.service';
|
||||||
@ -23,8 +23,6 @@ export class REDDocumentViewer {
|
|||||||
selectedText = '';
|
selectedText = '';
|
||||||
#document: DocumentViewer;
|
#document: DocumentViewer;
|
||||||
|
|
||||||
readonly #documentClosed$ = new Subject<undefined>();
|
|
||||||
|
|
||||||
readonly #logger = inject(NGXLogger);
|
readonly #logger = inject(NGXLogger);
|
||||||
readonly #userPreferenceService = inject(UserPreferenceService);
|
readonly #userPreferenceService = inject(UserPreferenceService);
|
||||||
readonly #pdf = inject(PdfViewer);
|
readonly #pdf = inject(PdfViewer);
|
||||||
@ -39,7 +37,7 @@ export class REDDocumentViewer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get #documentUnloaded$() {
|
get #documentUnloaded$() {
|
||||||
const event$ = merge(fromEvent(this.#document, 'documentUnloaded'), this.#documentClosed$);
|
const event$ = fromEvent(this.#document, 'documentUnloaded');
|
||||||
const toBool$ = event$.pipe(map(() => false));
|
const toBool$ = event$.pipe(map(() => false));
|
||||||
|
|
||||||
return toBool$.pipe(tap(() => this.#logger.info('[PDF] Document unloaded')));
|
return toBool$.pipe(tap(() => this.#logger.info('[PDF] Document unloaded')));
|
||||||
@ -101,8 +99,6 @@ export class REDDocumentViewer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
this.#documentClosed$.next(undefined);
|
|
||||||
|
|
||||||
const closeAction = async () => {
|
const closeAction = async () => {
|
||||||
this.#logger.info('[PDF] Closing document');
|
this.#logger.info('[PDF] Closing document');
|
||||||
this.#document.closeDocument();
|
this.#document.closeDocument();
|
||||||
@ -173,7 +169,7 @@ export class REDDocumentViewer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async #flattenAnnotations() {
|
async #flattenAnnotations() {
|
||||||
const pdfDoc = await this.#document.getDocument().getPDFDoc();
|
const pdfDoc = await this.PDFDoc;
|
||||||
await pdfDoc.flattenAnnotations(false);
|
await pdfDoc.flattenAnnotations(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "redaction",
|
"name": "redaction",
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user