diff --git a/server/src/main/resources/web/pdf.ftl b/server/src/main/resources/web/pdf.ftl index 4d5a26f5..845ac8ca 100644 --- a/server/src/main/resources/web/pdf.ftl +++ b/server/src/main/resources/web/pdf.ftl @@ -37,7 +37,14 @@ } function goForImage() { - var url = window.location.href + "&tifPreviewType=jpg" + var url = window.location.href + + if (url.indexOf("tifPreviewType=pdf") != -1) { + url = url.replace("tifPreviewType=pdf", "tifPreviewType=jpg"); + } else { + url = url + "&tifPreviewType=jpg"; + } + if (url.indexOf("officePreviewType=pdf") != -1) { url = url.replace("officePreviewType=pdf", "officePreviewType=image"); } else {