diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/AttachmentRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/AttachmentRoutes.scala index a7bc4b82..fb7409b7 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/AttachmentRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/AttachmentRoutes.scala @@ -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" => diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/ShareAttachmentRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/ShareAttachmentRoutes.scala index b93a1381..2f6fd6ad 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/ShareAttachmentRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/ShareAttachmentRoutes.scala @@ -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" => diff --git a/project/Dependencies.scala b/project/Dependencies.scala index a31217c5..f3f83d5f 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -34,6 +34,7 @@ object Dependencies { val MUnitCatsEffectVersion = "1.0.7" val OrganizeImportsVersion = "0.6.0" val PdfboxVersion = "2.0.25" + val PdfjsViewerVersion = "2.9.359" val PoiVersion = "4.1.2" val PostgresVersion = "42.3.1" val PureConfigVersion = "0.17.1" @@ -47,7 +48,6 @@ object Dependencies { val TestContainerVersion = "0.39.12" val TwelveMonkeysVersion = "3.8.1" val JQueryVersion = "3.5.1" - val ViewerJSVersion = "0.5.9" val jwtScala = Seq( "com.github.jwt-scala" %% "jwt-circe" % JwtScalaVersion @@ -310,8 +310,8 @@ object Dependencies { val webjars = Seq( "org.webjars" % "swagger-ui" % SwaggerUIVersion, - "org.webjars" % "viewerjs" % ViewerJSVersion, - "org.webjars" % "clipboard.js" % ClipboardJsVersion + "org.webjars" % "clipboard.js" % ClipboardJsVersion, + "org.webjars.npm" % "pdfjs-dist-viewer-min" % PdfjsViewerVersion ) val icu4j = Seq(