mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user