chore(display): add ai generated pdf.js integration (#58)

Co-authored-by: E44 <129310925+programmer-44@users.noreply.github.com>
Reviewed-on: https://codeberg.org/PLG-Development/PLG-MuDiCS/pulls/58
This commit is contained in:
E44
2026-06-14 22:10:04 +02:00
parent 2dc46c186e
commit 21cb07a465
8 changed files with 285 additions and 1 deletions
+6 -1
View File
@@ -40,7 +40,12 @@ func OpenFile(path string) error {
_ = imageTemplate(path).Render(context.Background(), &templateBuffer)
err = browser.Browser.OpenHTML(templateBuffer.String())
case "application/pdf":
err = browser.Browser.OpenPDF(path)
var templateBuffer bytes.Buffer
err = pdfTemplate(path, "http://127.0.0.1:1323").Render(context.Background(), &templateBuffer)
if err == nil {
err = browser.Browser.OpenHTML(templateBuffer.String())
}
case "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.oasis.opendocument.presentation":
err = fileHandler.openFileWithApp(path)
default: