Skip to content

Commit

Permalink
feat(core/reports): set image width from styles
Browse files Browse the repository at this point in the history
  • Loading branch information
robzan8 authored and trik committed Mar 8, 2021
1 parent 71a146b commit 7359a03
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/reports/report-to-pdf/report-to-pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ function imageToPdf(image: AjfImageWidgetInstance, images: ImageMap, width: numb
if (dataUrl == null) {
return {text: ''};
}
const w = image.styles.width;
if (typeof(w) === 'string' && w.endsWith('px')) {
width = Number(w.slice(0, -2));
}
return {image: dataUrl, width, margin: [0, 0, 0, marginBetweenWidgets]};
}

Expand Down

0 comments on commit 7359a03

Please sign in to comment.