diff --git a/angular.json b/angular.json index c259800f9..83a21f622 100644 --- a/angular.json +++ b/angular.json @@ -49,7 +49,7 @@ { "glob": "**/*", "input": "node_modules/@pdftron/webviewer/public/", - "output": "/assets/wv-resources/" + "output": "/assets/wv-resources/10.9.0" }, { "glob": "**/*", diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.ts index 5e8d8d0b7..84a0b7864 100644 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.ts @@ -61,6 +61,13 @@ interface WatermarkForm { styleUrls: ['./watermark-screen.component.scss'], }) export class WatermarkScreenComponent implements OnInit { + @ViewChild('viewer', { static: true }) private readonly _viewer: ElementRef; + readonly #loaded$ = new BehaviorSubject(false); + readonly #dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID); + readonly #watermarkId = Number(getParam(WATERMARK_ID)); + readonly #config = getConfig(); + #watermark: Partial = {}; + readonly #convertPath = inject(UI_ROOT_PATH_FN); readonly iconButtonTypes = IconButtonTypes; readonly translations = watermarkTranslations; readonly trackBy = trackByFactory(); @@ -78,13 +85,6 @@ export class WatermarkScreenComponent implements OnInit { readonly watermarkHorizontalAlignments = Object.values(WATERMARK_HORIZONTAL_ALIGNMENTS); readonly watermarkVerticalAlignments = Object.values(WATERMARK_VERTICAL_ALIGNMENTS); currentAlignment: WatermarkAlignment; - @ViewChild('viewer', { static: true }) private readonly _viewer: ElementRef; - readonly #loaded$ = new BehaviorSubject(false); - readonly #dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID); - readonly #watermarkId = Number(getParam(WATERMARK_ID)); - readonly #config = getConfig(); - #watermark: Partial = {}; - readonly #convertPath = inject(UI_ROOT_PATH_FN); constructor( private readonly _http: HttpClient, @@ -217,7 +217,7 @@ export class WatermarkScreenComponent implements OnInit { this.instance = await WebViewer( { licenseKey: this._licenseService.activeLicenseKey, - path: this.#convertPath('/assets/wv-resources'), + path: this.#convertPath('/assets/wv-resources/10.9.0'), css: this.#convertPath('/assets/pdftron/stylesheet.css'), fullAPI: true, isReadOnly: true, diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts index b9156816b..1e346f095 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts @@ -25,6 +25,25 @@ import TextTool = Core.Tools.TextTool; @Injectable() export class PdfViewer { + #instance: WebViewerInstance; + readonly #convertPath = inject(UI_ROOT_PATH_FN); + readonly #licenseKey = inject(LicenseService).activeLicenseKey; + readonly #config = getConfig(); + readonly #isCompareMode = signal(false); + readonly #isCompareMode$ = toObservable(this.#isCompareMode); + readonly #searchButton: IHeaderElement = { + type: 'actionButton', + img: this.#convertPath('/assets/icons/general/pdftron-action-search.svg'), + title: inject(TranslateService).instant(_('pdf-viewer.text-popup.actions.search')), + onClick: () => { + setTimeout(() => { + this.#searchForSelectedText(); + this.#focusSearch(); + }, 250); + }, + }; + readonly #destroyRef = inject(DestroyRef); + readonly #totalPages = signal(0); readonly currentPage$ = inject(ActivatedRoute).queryParamMap.pipe( map(params => Number(params.get('page') ?? '1')), shareDistinctLast(), @@ -45,25 +64,6 @@ export class PdfViewer { ambientString: true, // return ambient string as part of the result }; selectedText = ''; - #instance: WebViewerInstance; - readonly #convertPath = inject(UI_ROOT_PATH_FN); - readonly #licenseKey = inject(LicenseService).activeLicenseKey; - readonly #config = getConfig(); - readonly #isCompareMode = signal(false); - readonly #isCompareMode$ = toObservable(this.#isCompareMode); - readonly #searchButton: IHeaderElement = { - type: 'actionButton', - img: this.#convertPath('/assets/icons/general/pdftron-action-search.svg'), - title: inject(TranslateService).instant(_('pdf-viewer.text-popup.actions.search')), - onClick: () => { - setTimeout(() => { - this.#searchForSelectedText(); - this.#focusSearch(); - }, 250); - }, - }; - readonly #destroyRef = inject(DestroyRef); - readonly #totalPages = signal(0); constructor( private readonly _logger: NGXLogger, @@ -355,7 +355,7 @@ export class PdfViewer { const options: WebViewerOptions = { licenseKey: this.#licenseKey, fullAPI: true, - path: this.#convertPath('/assets/wv-resources'), + path: this.#convertPath('/assets/wv-resources/10.9.0'), css: this.#convertPath('/assets/pdftron/stylesheet.css'), backendType: 'ems', };