|
|
@ -88,6 +88,12 @@ public class PdfChunk { |
|
|
|
|
|
|
|
|
|
|
|
private static final float FONT_SCALE = 100f; |
|
|
|
private static final float FONT_SCALE = 100f; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String BREAK = "\n"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String BREAK_TAG = "<br>"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean breakTag = false; |
|
|
|
|
|
|
|
|
|
|
|
public float getHeight() { |
|
|
|
public float getHeight() { |
|
|
|
return height; |
|
|
|
return height; |
|
|
|
} |
|
|
|
} |
|
|
@ -200,6 +206,7 @@ public class PdfChunk { |
|
|
|
PdfChunk(String string, PdfChunk other) { |
|
|
|
PdfChunk(String string, PdfChunk other) { |
|
|
|
thisChunk[0] = this; |
|
|
|
thisChunk[0] = this; |
|
|
|
value = string; |
|
|
|
value = string; |
|
|
|
|
|
|
|
updateBreakTag(); |
|
|
|
this.font = other.font; |
|
|
|
this.font = other.font; |
|
|
|
this.attributes = other.attributes; |
|
|
|
this.attributes = other.attributes; |
|
|
|
this.noStroke = other.noStroke; |
|
|
|
this.noStroke = other.noStroke; |
|
|
@ -218,7 +225,7 @@ public class PdfChunk { |
|
|
|
this.height = other.getHeight(); |
|
|
|
this.height = other.getHeight(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Constructs a <CODE>PdfChunk</CODE>-object. |
|
|
|
* Constructs a <CODE>PdfChunk</CODE>-object. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param chunk the original <CODE>Chunk</CODE>-object |
|
|
|
* @param chunk the original <CODE>Chunk</CODE>-object |
|
|
@ -228,7 +235,7 @@ public class PdfChunk { |
|
|
|
public PdfChunk(Chunk chunk, PdfAction action) { |
|
|
|
public PdfChunk(Chunk chunk, PdfAction action) { |
|
|
|
thisChunk[0] = this; |
|
|
|
thisChunk[0] = this; |
|
|
|
value = chunk.getContent(); |
|
|
|
value = chunk.getContent(); |
|
|
|
|
|
|
|
updateBreakTag(); |
|
|
|
Font f = chunk.getFont(); |
|
|
|
Font f = chunk.getFont(); |
|
|
|
float size = f.getSize(); |
|
|
|
float size = f.getSize(); |
|
|
|
if (size == Font.UNDEFINED) |
|
|
|
if (size == Font.UNDEFINED) |
|
|
@ -798,7 +805,7 @@ public class PdfChunk { |
|
|
|
htmlString.append("<span style='"); |
|
|
|
htmlString.append("<span style='"); |
|
|
|
htmlString.append(getStyleAttributes()).append("'"); |
|
|
|
htmlString.append(getStyleAttributes()).append("'"); |
|
|
|
htmlString.append(">"); |
|
|
|
htmlString.append(">"); |
|
|
|
htmlString.append(value); |
|
|
|
htmlString.append(breakTag ? BREAK_TAG : value); |
|
|
|
htmlString.append("</span>"); |
|
|
|
htmlString.append("</span>"); |
|
|
|
return htmlString.toString(); |
|
|
|
return htmlString.toString(); |
|
|
|
} |
|
|
|
} |
|
|
@ -856,4 +863,12 @@ public class PdfChunk { |
|
|
|
return indent.getLeft(); |
|
|
|
return indent.getLeft(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updateBreakTag() { |
|
|
|
|
|
|
|
breakTag = BREAK.equals(value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isBreakTag() { |
|
|
|
|
|
|
|
return breakTag; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|