many fixes and tweaks, now it actually works!
authorjohn <john>
Fri, 27 Sep 2002 11:54:24 +0000 (11:54 +0000)
committerjohn <john>
Fri, 27 Sep 2002 11:54:24 +0000 (11:54 +0000)
source/mircoders/producer/PDFPreFormattingProducerNode.java

index 43dd3c5..e4f9f21 100755 (executable)
@@ -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 {