From 804ca8cf58cc0554332b1c79e6a54f6c7063418d Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 13 Sep 2018 17:02:59 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-10262=20html=E5=A4=A7=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E7=B2=BE=E7=A1=AE=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fine-itext/src/com/fr/third/v2/lowagie/text/html/Markup.java | 4 ++-- .../v2/lowagie/text/html/simpleparser/FactoryProperties.java | 4 ++++ fine-itext/src/com/fr/third/v2/lowagie/text/pdf/PdfChunk.java | 2 +- fine-itext/src/com/fr/third/v2/lowagie/text/pdf/PdfLine.java | 2 -- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fine-itext/src/com/fr/third/v2/lowagie/text/html/Markup.java b/fine-itext/src/com/fr/third/v2/lowagie/text/html/Markup.java index 0a6b5ea25..763bbde5a 100644 --- a/fine-itext/src/com/fr/third/v2/lowagie/text/html/Markup.java +++ b/fine-itext/src/com/fr/third/v2/lowagie/text/html/Markup.java @@ -449,9 +449,9 @@ public class Markup { if (part.length == 2) { key = stripDoubleSpacesAndTrim(part[0]).toLowerCase(); value = stripDoubleSpacesAndTrim(part[1]); - if (value.startsWith("\"")) + if (value.startsWith("\"") || value.startsWith("\'") ) value = value.substring(1); - if (value.endsWith("\"")) + if (value.endsWith("\"") || value.endsWith("\'")) value = value.substring(0, value.length() - 1); result.setProperty(key.toLowerCase(), value); } diff --git a/fine-itext/src/com/fr/third/v2/lowagie/text/html/simpleparser/FactoryProperties.java b/fine-itext/src/com/fr/third/v2/lowagie/text/html/simpleparser/FactoryProperties.java index 86146180e..418bb954f 100644 --- a/fine-itext/src/com/fr/third/v2/lowagie/text/html/simpleparser/FactoryProperties.java +++ b/fine-itext/src/com/fr/third/v2/lowagie/text/html/simpleparser/FactoryProperties.java @@ -137,6 +137,9 @@ public class FactoryProperties { if(props.hasPropertyInChain("div", "background")){ p.setBackground(props.getPropertyFromChain("div", "background")); } + if(props.hasProperty("line-height")){ + p.setAttribute("line-height", props.getProperty("line-height")); + } for(String margin : HtmlConstants.MARGIN){ if(props.hasPropertyInChain("div", margin)){ String ss = props.getPropertyFromChain("div", margin); @@ -419,6 +422,7 @@ public class FactoryProperties { return; } h.put("leading", v + ",0"); + h.put("line-height", ss); } else if (key.equals(Markup.CSS_KEY_TEXTALIGN)) { String ss = prop.getProperty(key).trim().toLowerCase(); h.put("align", ss); diff --git a/fine-itext/src/com/fr/third/v2/lowagie/text/pdf/PdfChunk.java b/fine-itext/src/com/fr/third/v2/lowagie/text/pdf/PdfChunk.java index bd2c00394..09dce3311 100644 --- a/fine-itext/src/com/fr/third/v2/lowagie/text/pdf/PdfChunk.java +++ b/fine-itext/src/com/fr/third/v2/lowagie/text/pdf/PdfChunk.java @@ -394,7 +394,7 @@ public class PdfChunk { } // otherwise, the string has to be truncated String returnValue = value.substring(start); - value = trim(value.substring(0, start)); + value = value.substring(0, start); PdfChunk pc = new PdfChunk(returnValue, this); return pc; } diff --git a/fine-itext/src/com/fr/third/v2/lowagie/text/pdf/PdfLine.java b/fine-itext/src/com/fr/third/v2/lowagie/text/pdf/PdfLine.java index 799f81e16..4752ffd8e 100644 --- a/fine-itext/src/com/fr/third/v2/lowagie/text/pdf/PdfLine.java +++ b/fine-itext/src/com/fr/third/v2/lowagie/text/pdf/PdfLine.java @@ -176,8 +176,6 @@ public class PdfLine { } // if the length of the chunk > 0 we add it to the line else if (chunk.length() > 0 || chunk.isImage()) { - if (overflow != null) - chunk.trimLastSpace(); width -= chunk.width(); addToLine(chunk); }