aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas')
-rw-r--r--pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFBoxTable.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFBoxTable.java b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFBoxTable.java
index d5c5d683..82d21b0f 100644
--- a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFBoxTable.java
+++ b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/pdfbox/PDFBoxTable.java
@@ -549,10 +549,14 @@ public class PDFBoxTable {
// }
}
Dimension dim = ImageUtils.getImageDimensions(imageFile, settings);
- if (dim.getHeight() > 80.0f) {
- return width + padding * 2;
- }
- return (float) dim.getHeight() + padding * 2;
+ float wfactor = (float) ((width - padding * 2.0f) / dim.getWidth());
+ float scaleFactor = wfactor;
+ float iheight = (float) Math
+ .floor((double) (scaleFactor * dim.getHeight()));
+ //if (dim.getHeight() > 80.0f) {
+ // return width + padding * 2;
+ //}
+ return (float) iheight + padding * 2;
case Entry.TYPE_TABLE:
PDFBoxTable pdfBoxTable = null;
if (cell.getValue() instanceof Table) {