Started generating SVG images for HTML5 client instead of PNG.

This commit is contained in:
Maxim Khlobystov 2015-07-03 12:20:37 -04:00
parent aafbbd2948
commit 16314d5edd
2 changed files with 3 additions and 3 deletions

View File

@ -157,7 +157,7 @@ class PresentationController {
if (pres.exists()) {
def bytes = pres.readBytes()
response.addHeader("Cache-Control", "no-cache")
response.contentType = 'image/png'
response.contentType = 'image/svg'
response.outputStream << bytes;
}
} catch (IOException e) {

View File

@ -65,8 +65,8 @@ public class PngImageCreatorImp implements PngImageCreator {
}else{
for(int i=1; i<=pres.getNumberOfPages(); i++){
File tmp = new File(imagePresentationDir.getAbsolutePath() + File.separatorChar + "tmp" + File.separatorChar + "slide" + i + ".pdf");
File destpng = new File(imagePresentationDir.getAbsolutePath() + File.separatorChar + "slide" + i + ".png");
COMMAND = IMAGEMAGICK_DIR + "/convert -density 300x300 -quality 90 +dither -depth 8 -colors 256 " + File.separatorChar + tmp.getAbsolutePath() + " " + destpng.getAbsolutePath();
File destpng = new File(imagePresentationDir.getAbsolutePath() + File.separatorChar + "slide" + i + ".svg");
COMMAND = "pdftocairo -svg -q -f 1 -l 1 " + File.separatorChar + tmp.getAbsolutePath() + " " + destpng.getAbsolutePath();
done = new ExternalProcessExecutor().exec(COMMAND, 60000);
if(!done){