A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Merge branch 'dev' into pdf-viewer-mobile-improvements
Michael Shamoon069e78881dc0
diff --cc src-ui/src/app/components/document-detail/document-detail.component.htmlindex 970fa361c,989c998f1..10a1ee83c--- a/src-ui/src/app/components/document-detail/document-detail.component.html+++ b/src-ui/src/app/components/document-detail/document-detail.component.html@@@ -180,9 -133,18 +142,18 @@@</form></div>- <div class="col-md-6 col-xl-8 mb-3">+ <div class="col-md-6 col-xl-8 mb-3 d-none d-md-block" #pdfPreview>- <div class="pdf-viewer-container" *ngIf="getContentType() == 'application/pdf'">- <pdf-viewer [src]="previewUrl" [original-size]="false" [show-borders]="true"></pdf-viewer>- </div>+ <ng-container *ngIf="getContentType() == 'application/pdf'">+ <div class="preview-sticky pdf-viewer-container" *ngIf="!useNativePdfViewer ; else nativePdfViewer">+ <pdf-viewer [src]="previewUrl" [original-size]="false" [show-borders]="true" [show-all]="true" [(page)]="previewCurrentPage" [render-text-mode]="2" (after-load-complete)="pdfPreviewLoaded($event)"></pdf-viewer>+ </div>+ <ng-template #nativePdfViewer>+ <object [data]="previewUrl | safe" class="preview-sticky" width="100%"></object>+ </ng-template>+ </ng-container>+ <ng-container *ngIf="getContentType() == 'text/plain'">+ <object [data]="previewUrl | safe" type="text/plain" class="preview-sticky" width="100%"></object>+ </ng-container>+</div></div>diff --cc src-ui/src/app/components/document-detail/document-detail.component.tsindex fcbbf840c,493e61d35..e711b3416--- a/src-ui/src/app/components/document-detail/document-detail.component.ts+++ b/src-ui/src/app/components/document-detail/document-detail.component.ts@@@ -1,8 -1,7 +1,7 @@@-import { Component, OnInit, ViewChild } from '@angular/core';+import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';import { FormControl, FormGroup } from '@angular/forms';- import { Title } from '@angular/platform-browser';import { ActivatedRoute, Router } from '@angular/router';-import { NgbModal } from '@ng-bootstrap/ng-bootstrap';+import { NgbModal, NgbNav } from '@ng-bootstrap/ng-bootstrap';import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent';import { PaperlessDocument } from 'src/app/data/paperless-document';import { PaperlessDocumentMetadata } from 'src/app/data/paperless-document-metadata';@@@ -48,15 -62,9 +62,18 @@@ export class DocumentDetailComponent imtags: new FormControl([])})+ previewCurrentPage: number = 1+ previewNumPages: number = 1++ @ViewChild('nav') nav: NgbNav+ @ViewChild('pdfPreview') set pdfPreview(element) {+ // this gets called when compontent added or removed from DOM+ if (element && element.nativeElement.offsetParent !== null) { // its visible++ setTimeout(()=> this.nav?.select(1));+ }+ }+constructor(private documentsService: DocumentService,private route: ActivatedRoute,