From 889afe6aaa7b6b64c03e66e7c16ef98faa40314b Mon Sep 17 00:00:00 2001 From: john Date: Fri, 27 Sep 2002 11:54:24 +0000 Subject: [PATCH] many fixes and tweaks, now it actually works! --- source/mircoders/producer/PDFPreFormattingProducerNode.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/mircoders/producer/PDFPreFormattingProducerNode.java b/source/mircoders/producer/PDFPreFormattingProducerNode.java index 43dd3c50..e4f9f213 100755 --- a/source/mircoders/producer/PDFPreFormattingProducerNode.java +++ b/source/mircoders/producer/PDFPreFormattingProducerNode.java @@ -134,14 +134,15 @@ public class PDFPreFormattingProducerNode implements ProducerNode { } - //calculate how much text goes in the column - float text_widthCM = contentAreaWidthCM-(img_width*pixelWidthCM); + //calculate how much text goes in the column(use 8 pixels to pad the column) + float text_widthCM = contentAreaWidthCM-((img_width+8)*pixelWidthCM); float number_of_lines = img_height*pixelWidthCM/lineHeightCM; //don't worry we will make it an int - int text_amount= (new Float((text_widthCM/characterWidthCM)*number_of_lines)).intValue(); + //add one line for image description + int text_amount= (new Float((text_widthCM/characterWidthCM)*(number_of_lines+1))).intValue(); row1.put("text_widthCM",Float.toString(text_widthCM)); - - + + row1.put("img_title",currentImage.getValue("title")); row1.put("img_width",Float.toString(img_width)); row1.put("img_height",Float.toString(img_height)); @@ -149,7 +150,7 @@ public class PDFPreFormattingProducerNode implements ProducerNode { aLogger.println("img_width " +Float.toString(img_width)); aLogger.println("img_height "+Float.toString(img_height)); - row1.put("img_src",currentImage.getValue("source")); + row1.put("img_src",currentImage.getValue("publish_path")); row1.put("hasImage","1"); if (! outOfText){ try { -- 2.11.0