Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace viewerjs with pdfjs viewer #1304

Merged
merged 1 commit into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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" =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" =>
Expand Down
6 changes: 3 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand Down