|
|
|
@ -88,6 +88,12 @@ public class PdfChunk {
|
|
|
|
|
|
|
|
|
|
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() { |
|
|
|
|
return height; |
|
|
|
|
} |
|
|
|
@ -200,6 +206,7 @@ public class PdfChunk {
|
|
|
|
|
PdfChunk(String string, PdfChunk other) { |
|
|
|
|
thisChunk[0] = this; |
|
|
|
|
value = string; |
|
|
|
|
updateBreakTag(); |
|
|
|
|
this.font = other.font; |
|
|
|
|
this.attributes = other.attributes; |
|
|
|
|
this.noStroke = other.noStroke; |
|
|
|
@ -228,7 +235,7 @@ public class PdfChunk {
|
|
|
|
|
public PdfChunk(Chunk chunk, PdfAction action) { |
|
|
|
|
thisChunk[0] = this; |
|
|
|
|
value = chunk.getContent(); |
|
|
|
|
|
|
|
|
|
updateBreakTag(); |
|
|
|
|
Font f = chunk.getFont(); |
|
|
|
|
float size = f.getSize(); |
|
|
|
|
if (size == Font.UNDEFINED) |
|
|
|
@ -798,7 +805,7 @@ public class PdfChunk {
|
|
|
|
|
htmlString.append("<span style='"); |
|
|
|
|
htmlString.append(getStyleAttributes()).append("'"); |
|
|
|
|
htmlString.append(">"); |
|
|
|
|
htmlString.append(value); |
|
|
|
|
htmlString.append(breakTag ? BREAK_TAG : value); |
|
|
|
|
htmlString.append("</span>"); |
|
|
|
|
return htmlString.toString(); |
|
|
|
|
} |
|
|
|
@ -856,4 +863,12 @@ public class PdfChunk {
|
|
|
|
|
return indent.getLeft(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void updateBreakTag() { |
|
|
|
|
breakTag = BREAK.equals(value); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public boolean isBreakTag() { |
|
|
|
|
return breakTag; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|