Merge pull request #2326 from tsiegleauq/issue2301

Limit image scale in pdf documents (fixes #2301)
This commit is contained in:
Norman Jäckel 2016-09-06 16:41:58 +02:00 committed by GitHub
commit 261b23affa
3 changed files with 32 additions and 2 deletions

View File

@ -318,6 +318,10 @@ img {
margin-right: 13px; margin-right: 13px;
} }
.col1 .details img {
max-width: 100%;
height: auto;
}
.col1 ul, .col1 ol { .col1 ul, .col1 ol {
margin-left: 20px; margin-left: 20px;
} }

View File

@ -119,6 +119,10 @@ body{
z-index: -1; z-index: -1;
line-height: 1.3em; line-height: 1.3em;
} }
.content img {
max-width: 65%;
height: auto;
}
.scrollcontent { .scrollcontent {
transition-property: margin, font-size; transition-property: margin, font-size;
transition-duration: 1s; transition-duration: 1s;

View File

@ -355,10 +355,32 @@ angular.module('OpenSlidesApp.core.site', [
alreadyConverted.push(stack); alreadyConverted.push(stack);
break; break;
case "img": case "img":
// TODO: need a proper way to calculate the space
// left on the page.
// This requires further information
// A4 in 72dpi: 595px x 842px
var maxResolution = {
width: 435,
height: 830
},
width = parseInt(element.getAttribute("width")),
height = parseInt(element.getAttribute("height"));
if (width > maxResolution.width) {
var scaleByWidth = maxResolution.width/width;
width *= scaleByWidth;
height *= scaleByWidth;
}
if (height > maxResolution.height) {
var scaleByHeight = maxResolution.height/height;
width *= scaleByHeight;
height *= scaleByHeight;
}
alreadyConverted.push({ alreadyConverted.push({
image: BaseMap[element.getAttribute("src")], image: BaseMap[element.getAttribute("src")],
width: parseInt(element.getAttribute("width")), width: width,
height: parseInt(element.getAttribute("height")) height: height
}); });
break; break;
case "ul": case "ul":