Replace viewerjs with pdfjs viewer

The pdfjs distribution contains a standalone viewer already.
This commit is contained in:
eikek
2022-01-19 23:05:00 +01:00
parent 0fd08b2ec1
commit 73f47d7be3
3 changed files with 7 additions and 5 deletions

View File

@ -133,7 +133,8 @@ object AttachmentRoutes {
// this route exists to provide a stable url
// it redirects currently to viewerjs
val attachUrl = s"/api/v1/sec/attachment/${id.id}"
val path = s"/app/assets${Webjars.viewerjs}/index.html#$attachUrl"
val path =
s"/app/assets${Webjars.pdfjsdistviewermin}/build/minified/web/viewer.html?file=$attachUrl"
SeeOther(Location(Uri(path = Uri.Path.unsafeFromString(path))))
case GET -> Root / Ident(id) / "meta" =>

View File

@ -45,7 +45,8 @@ object ShareAttachmentRoutes {
// this route exists to provide a stable url
// it redirects currently to viewerjs
val attachUrl = s"/api/v1/share/attachment/${id.id}"
val path = s"/app/assets${Webjars.viewerjs}/index.html#$attachUrl"
val path =
s"/app/assets${Webjars.pdfjsdistviewermin}/build/minified/web/viewer.html?file=$attachUrl"
SeeOther(Location(Uri(path = Uri.Path.unsafeFromString(path))))
case req @ GET -> Root / Ident(id) / "preview" =>