A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Inline plaintext document previews for complete styling
shamoon6ed637cfddb4
diff --git a/src-ui/messages.xlf b/src-ui/messages.xlfindex 04f08a861..88a80f55c 100644--- a/src-ui/messages.xlf+++ b/src-ui/messages.xlf@@ -2706,43 +2706,54 @@<context context-type="linenumber">195</context></context-group></trans-unit>+ <trans-unit id="2218903673684131427" datatype="html">+ <source>An error occurred loading content: <x id="PH" equiv-text="err.message ?? err.toString()"/></source>+ <context-group purpose="location">+ <context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>+ <context context-type="linenumber">228</context>+ </context-group>+ </trans-unit><trans-unit id="5758784066858623886" datatype="html"><source>Error retrieving metadata</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">341</context>+ <context context-type="linenumber">354</context></context-group></trans-unit><trans-unit id="2374084708811774419" datatype="html"><source>Error retrieving suggestions</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">361</context>+ <context context-type="linenumber">374</context></context-group></trans-unit><trans-unit id="8348337312757497317" datatype="html"><source>Document saved successfully.</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">478</context>+ <context context-type="linenumber">484</context>+ </context-group>+ <context-group purpose="location">+ <context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>+ <context context-type="linenumber">492</context></context-group></trans-unit><trans-unit id="448882439049417053" datatype="html"><source>Error saving document</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">483</context>+ <context context-type="linenumber">497</context></context-group><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">528</context>+ <context context-type="linenumber">542</context></context-group></trans-unit><trans-unit id="9021887951960049161" datatype="html"><source>Confirm delete</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">557</context>+ <context context-type="linenumber">571</context></context-group><context-group purpose="location"><context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context>@@ -2753,35 +2764,35 @@<source>Do you really want to delete document "<x id="PH" equiv-text="this.document.title"/>"?</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">558</context>+ <context context-type="linenumber">572</context></context-group></trans-unit><trans-unit id="6691075929777935948" datatype="html"><source>The files for this document will be deleted permanently. This operation cannot be undone.</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">559</context>+ <context context-type="linenumber">573</context></context-group></trans-unit><trans-unit id="719892092227206532" datatype="html"><source>Delete document</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">561</context>+ <context context-type="linenumber">575</context></context-group></trans-unit><trans-unit id="1844801255494293730" datatype="html"><source>Error deleting document: <x id="PH" equiv-text="JSON.stringify(error)"/></source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">577</context>+ <context context-type="linenumber">591</context></context-group></trans-unit><trans-unit id="7362691899087997122" datatype="html"><source>Redo OCR confirm</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">597</context>+ <context context-type="linenumber">611</context></context-group><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-list/bulk-editor/bulk-editor.component.ts</context>@@ -2792,14 +2803,14 @@<source>This operation will permanently redo OCR for this document.</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">598</context>+ <context context-type="linenumber">612</context></context-group></trans-unit><trans-unit id="5641451190833696892" datatype="html"><source>This operation cannot be undone.</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">599</context>+ <context context-type="linenumber">613</context></context-group><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-list/bulk-editor/bulk-editor.component.ts</context>@@ -2830,7 +2841,7 @@<source>Proceed</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">601</context>+ <context context-type="linenumber">615</context></context-group><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-list/bulk-editor/bulk-editor.component.ts</context>@@ -2857,7 +2868,7 @@<source>Redo OCR operation will begin in the background. Close and re-open or reload this document after the operation has completed to see new content.</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">609</context>+ <context context-type="linenumber">623</context></context-group></trans-unit><trans-unit id="8008978164775353960" datatype="html">@@ -2866,7 +2877,7 @@)"/></source><context-group purpose="location"><context context-type="sourcefile">src/app/components/document-detail/document-detail.component.ts</context>- <context context-type="linenumber">620,622</context>+ <context context-type="linenumber">634,636</context></context-group></trans-unit><trans-unit id="6857598786757174736" datatype="html">diff --git a/src-ui/src/app/components/document-detail/document-detail.component.html b/src-ui/src/app/components/document-detail/document-detail.component.htmlindex 828f19c5f..c88dc7e98 100644--- a/src-ui/src/app/components/document-detail/document-detail.component.html+++ b/src-ui/src/app/components/document-detail/document-detail.component.html@@ -208,7 +208,7 @@</ng-template></ng-container><ng-container *ngIf="getContentType() === 'text/plain'">- <object [data]="previewUrl | safeUrl" type="text/plain" class="preview-sticky bg-white" width="100%"></object>+ <div [innerHTML]="previewHtml | safeHtml" class="preview-sticky bg-light p-3" width="100%"></div></ng-container><div *ngIf="requiresPassword" class="password-prompt"><form>diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.tsindex 9c5efe8f6..31e600b7d 100644--- a/src-ui/src/app/components/document-detail/document-detail.component.ts+++ b/src-ui/src/app/components/document-detail/document-detail.component.ts@@ -43,6 +43,7 @@ import {import { PaperlessUser } from 'src/app/data/paperless-user'import { UserService } from 'src/app/services/rest/user.service'import { PaperlessDocumentNote } from 'src/app/data/paperless-document-note'+import { HttpClient } from '@angular/common/http'enum DocumentDetailNavIDs {Details = 1,@@ -80,6 +81,7 @@ export class DocumentDetailComponenttitle: stringtitleSubject: Subject<string> = new Subject()previewUrl: string+ _previewHtml: stringdownloadUrl: stringdownloadOriginalUrl: string@@ -144,7 +146,8 @@ export class DocumentDetailComponentprivate settings: SettingsService,private storagePathService: StoragePathService,private permissionsService: PermissionsService,- private userService: UserService+ private userService: UserService,+ private http: HttpClient) {}titleKeyUp(event) {@@ -215,6 +218,16 @@ export class DocumentDetailComponentswitchMap((doc) => {this.documentId = doc.idthis.previewUrl = this.documentsService.getPreviewUrl(this.documentId)+ this.http.get(this.previewUrl, { responseType: 'text' }).subscribe({+ next: (res) => {+ this._previewHtml = res.toString()+ },+ error: (err) => {+ this._previewHtml = $localize`An error occurred loading content: ${+ err.message ?? err.toString()+ }`+ },+ })this.downloadUrl = this.documentsService.getDownloadUrl(this.documentId)@@ -706,4 +719,8 @@ export class DocumentDetailComponent))}++ get previewHtml(): string {+ return this._previewHtml+ }}diff --git a/src-ui/src/theme.scss b/src-ui/src/theme.scssindex 08a7d3c6d..0e750f555 100644--- a/src-ui/src/theme.scss+++ b/src-ui/src/theme.scss@@ -246,10 +246,6 @@ $form-check-radio-checked-bg-image-dark: url("data:image/svg+xml,<svg xmlns='httbackground-color: rgb(var(--bs-dark-rgb)) !important;}}-- .preview-sticky.bg-white {- background-color: var(--pngx-bg-darker) !important;- }}body.color-scheme-dark {