Merge branch 'master' into VM/RED-6774

This commit is contained in:
Valentin Mihai 2023-06-21 00:11:22 +03:00
commit 3ff33b5701
4 changed files with 9 additions and 8 deletions

View File

@ -182,6 +182,8 @@ export class FilePreviewScreenComponent
effect(() => {
if (this._viewModeService.viewMode()) {
this.updateViewMode().then();
this._logger.info('[PDF] Stamp pdf');
this._stampService.stampPDF().then();
}
});
}
@ -279,8 +281,6 @@ export class FilePreviewScreenComponent
}
}
this._logger.info('[PDF] Stamp pdf');
await this._stampService.stampPDF();
this._logger.info('[PDF] Rebuild filters');
this.#rebuildFilters();
this._logger.info('[PDF] Update done');

View File

@ -32,6 +32,7 @@ export class StampService {
const file = this._state.file();
const allPages = [...Array(file.numberOfPages).keys()].map(page => page + 1);
await pdfDoc.lock();
try {
await clearStamps(pdfDoc, this._pdf.PDFNet, allPages, this._licenseService.activeLicenseKey);
} catch (e) {
@ -48,7 +49,8 @@ export class StampService {
await this._stampExcludedPages(pdfDoc, file.excludedPages);
}
this._documentViewer.refreshAndUpdateView();
this._documentViewer.refreshAndUpdateView(Array.from({ length: await pdfDoc.getPageCount() }, (_x, i) => i + 1));
await pdfDoc.unlock();
}
private async _stampExcludedPages(document: PDFNet.PDFDoc, excludedPages: number[]): Promise<void> {

View File

@ -120,11 +120,10 @@ export class REDDocumentViewer {
}
}
refreshAndUpdateView() {
this.#document.refreshAll();
// do not adjust this page if is compare mode
refreshAndUpdateView(visiblePages: number[]) {
const currentPage = this.#document.getCurrentPage();
this.#document.updateView([currentPage], currentPage);
this.#document.refreshAll();
this.#document.updateView(visiblePages, currentPage);
}
resetRotation(pages: number | number[] | string | string[]) {

View File

@ -1,6 +1,6 @@
{
"name": "redaction",
"version": "4.129.0",
"version": "4.133.0",
"private": true,
"license": "MIT",
"scripts": {