if (style == null) return; Properties prop = Markup.parseAttributes(style); for (Iterator it = prop.keySet().iterator(); it.hasNext();) { String key = (String) it.next(); h.put("face", prop.getProperty(key)); } else if (key.equals(Markup.CSS_KEY_FONTSIZE)) { h.put("size", Float.toString(Markup.parseLength(prop .getProperty(key))) + "pt"); h.put("u", null); } else if (key.equals(Markup.CSS_KEY_COLOR)) { Color c = Markup.decodeColor(prop.getProperty(key)); if (c != null) { int hh = c.getRGB(); float v = Markup.parseLength(prop.getProperty(key)); if (ss.endsWith("%")) { h.put("leading", "0," + (v / 100));
if (value != null) size = Float.parseFloat(value); Color color = Markup.decodeColor(props.getProperty("color")); String encoding = props.getProperty("encoding"); if (encoding == null)
/** * Creates a Phrase object based on a list of properties. * @param attributes * @return a Phrase */ public static Phrase getPhrase(Properties attributes) { Phrase phrase = new Phrase(); phrase.setFont(FontFactory.getFont(attributes)); String value; value = attributes.getProperty(ElementTags.LEADING); if (value != null) { phrase.setLeading(Float.parseFloat(value + "f")); } value = attributes.getProperty(Markup.CSS_KEY_LINEHEIGHT); if (value != null) { phrase.setLeading(Markup.parseLength(value, Markup.DEFAULT_FONT_SIZE)); } value = attributes.getProperty(ElementTags.ITEXT); if (value != null) { Chunk chunk = new Chunk(value); if ((value = attributes.getProperty(ElementTags.GENERICTAG)) != null) { chunk.setGenericTag(value); } phrase.add(chunk); } return phrase; }
rect.setBorderColor(new Color(red, green, blue)); } else { rect.setBorderColor(Markup.decodeColor(attributes .getProperty(ElementTags.BORDERCOLOR))); rect.setBackgroundColor(new Color(red, green, blue)); } else if (value != null) { rect.setBackgroundColor(Markup.decodeColor(value)); } else { value = attributes.getProperty(ElementTags.GRAYFILL);
/** * Creates a Phrase object based on a list of properties. * @param attributes * @return a Phrase */ public static Phrase getPhrase(Properties attributes) { Phrase phrase = new Phrase(); phrase.setFont(FontFactory.getFont(attributes)); String value; value = attributes.getProperty(ElementTags.LEADING); if (value != null) { phrase.setLeading(Float.parseFloat(value + "f")); } value = attributes.getProperty(Markup.CSS_KEY_LINEHEIGHT); if (value != null) { phrase.setLeading(Markup.parseLength(value, Markup.DEFAULT_FONT_SIZE)); } value = attributes.getProperty(ElementTags.ITEXT); if (value != null) { Chunk chunk = new Chunk(value); if ((value = attributes.getProperty(ElementTags.GENERICTAG)) != null) { chunk.setGenericTag(value); } phrase.add(chunk); } return phrase; }
if (style == null) return; Properties prop = Markup.parseAttributes(style); for (Iterator it = prop.keySet().iterator(); it.hasNext();) { String key = (String) it.next(); h.put(ElementTags.FACE, prop.getProperty(key)); } else if (key.equals(Markup.CSS_KEY_FONTSIZE)) { float actualFontSize = Markup.parseLength(cprops .getProperty(ElementTags.SIZE), Markup.DEFAULT_FONT_SIZE); if (actualFontSize <= 0f) actualFontSize = Markup.DEFAULT_FONT_SIZE; h.put(ElementTags.SIZE, Float.toString(Markup.parseLength(prop .getProperty(key), actualFontSize)) + "pt"); h.put("u", null); } else if (key.equals(Markup.CSS_KEY_COLOR)) { Color c = Markup.decodeColor(prop.getProperty(key)); if (c != null) { int hh = c.getRGB(); float actualFontSize = Markup.parseLength(cprops .getProperty(ElementTags.SIZE), Markup.DEFAULT_FONT_SIZE); if (actualFontSize <= 0f) actualFontSize = Markup.DEFAULT_FONT_SIZE; float v = Markup.parseLength(prop.getProperty(key),
rect.setBorderColor(new Color(red, green, blue)); } else { rect.setBorderColor(Markup.decodeColor(attributes .getProperty(ElementTags.BORDERCOLOR))); rect.setBackgroundColor(new Color(red, green, blue)); } else if (value != null) { rect.setBackgroundColor(Markup.decodeColor(value)); } else { value = attributes.getProperty(ElementTags.GRAYFILL);
/** * Creates a Phrase object based on a list of properties. * @param attributes * @return a Phrase */ public static Phrase getPhrase(Properties attributes) { Phrase phrase = new Phrase(); phrase.setFont(FontFactory.getFont(attributes)); String value; value = attributes.getProperty(ElementTags.LEADING); if (value != null) { phrase.setLeading(Float.parseFloat(value + "f")); } value = attributes.getProperty(Markup.CSS_KEY_LINEHEIGHT); if (value != null) { phrase.setLeading(Markup.parseLength(value, Markup.DEFAULT_FONT_SIZE)); } value = attributes.getProperty(ElementTags.ITEXT); if (value != null) { Chunk chunk = new Chunk(value); if ((value = attributes.getProperty(ElementTags.GENERICTAG)) != null) { chunk.setGenericTag(value); } phrase.add(chunk); } return phrase; }
if (style == null) return; Properties prop = Markup.parseAttributes(style); for (Iterator it = prop.keySet().iterator(); it.hasNext();) { String key = (String) it.next(); h.put("face", prop.getProperty(key)); } else if (key.equals(Markup.CSS_KEY_FONTSIZE)) { h.put("size", Float.toString(Markup.parseLength(prop .getProperty(key))) + "pt"); h.put("u", null); } else if (key.equals(Markup.CSS_KEY_COLOR)) { Color c = Markup.decodeColor(prop.getProperty(key)); if (c != null) { int hh = c.getRGB(); float v = Markup.parseLength(prop.getProperty(key)); if (ss.endsWith("%")) { h.put("leading", "0," + (v / 100));
if (value != null) size = Float.parseFloat(value); Color color = Markup.decodeColor(props.getProperty("color")); String encoding = props.getProperty("encoding"); if (encoding == null)
float hrWidth = 1; if (width != null) { float tmpWidth = Markup.parseLength(width, Markup.DEFAULT_FONT_SIZE); if (tmpWidth > 0) hrWidth = tmpWidth; if (!width.endsWith("%")) float hrSize = 1; if (size != null) { float tmpSize = Markup.parseLength(size, Markup.DEFAULT_FONT_SIZE); if (tmpSize > 0) hrSize = tmpSize; if (after != null) img.setSpacingAfter(Float.parseFloat(after)); float actualFontSize = Markup.parseLength(cprops .getProperty(ElementTags.SIZE), Markup.DEFAULT_FONT_SIZE); if (actualFontSize <= 0f) actualFontSize = Markup.DEFAULT_FONT_SIZE; float widthInPoints = Markup.parseLength(width, actualFontSize); float heightInPoints = Markup.parseLength(height, actualFontSize); if (widthInPoints > 0 && heightInPoints > 0) {
if (style == null) return; Properties prop = Markup.parseAttributes(style); for (Iterator it = prop.keySet().iterator(); it.hasNext();) { String key = (String) it.next(); h.put("face", prop.getProperty(key)); } else if (key.equals(Markup.CSS_KEY_FONTSIZE)) { h.put("size", Markup.parseLength(prop .getProperty(key)) + "pt"); h.put("u", null); } else if (key.equals(Markup.CSS_KEY_COLOR)) { Color c = Markup.decodeColor(prop.getProperty(key)); if (c != null) { int hh = c.getRGB(); float v = Markup.parseLength(prop.getProperty(key)); if (ss.endsWith("%")) { h.put("leading", "0," + (v / 100));
if (value != null) size = Float.parseFloat(value); Color color = Markup.decodeColor(props.getProperty("color")); String encoding = props.getProperty("encoding"); if (encoding == null)
float hrWidth = 1; if (width != null) { float tmpWidth = Markup.parseLength(width, Markup.DEFAULT_FONT_SIZE); if (tmpWidth > 0) hrWidth = tmpWidth; if (!width.endsWith("%")) float hrSize = 1; if (size != null) { float tmpSize = Markup.parseLength(size, Markup.DEFAULT_FONT_SIZE); if (tmpSize > 0) hrSize = tmpSize; if (after != null) img.setSpacingAfter(Float.parseFloat(after)); float actualFontSize = Markup.parseLength(cprops .getProperty(ElementTags.SIZE), Markup.DEFAULT_FONT_SIZE); if (actualFontSize <= 0f) actualFontSize = Markup.DEFAULT_FONT_SIZE; float widthInPoints = Markup.parseLength(width, actualFontSize); float heightInPoints = Markup.parseLength(height, actualFontSize); if (widthInPoints > 0 && heightInPoints > 0) {
if (style == null) return; Properties prop = Markup.parseAttributes(style); for (Iterator it = prop.keySet().iterator(); it.hasNext();) { String key = (String) it.next(); h.put(ElementTags.FACE, prop.getProperty(key)); } else if (key.equals(Markup.CSS_KEY_FONTSIZE)) { float actualFontSize = Markup.parseLength(cprops .getProperty(ElementTags.SIZE), Markup.DEFAULT_FONT_SIZE); if (actualFontSize <= 0f) actualFontSize = Markup.DEFAULT_FONT_SIZE; h.put(ElementTags.SIZE, Float.toString(Markup.parseLength(prop .getProperty(key), actualFontSize)) + "pt"); h.put("u", null); } else if (key.equals(Markup.CSS_KEY_COLOR)) { Color c = Markup.decodeColor(prop.getProperty(key)); if (c != null) { int hh = c.getRGB(); float actualFontSize = Markup.parseLength(cprops .getProperty(ElementTags.SIZE), Markup.DEFAULT_FONT_SIZE); if (actualFontSize <= 0f) actualFontSize = Markup.DEFAULT_FONT_SIZE; float v = Markup.parseLength(prop.getProperty(key),
chunk.setBackground(Markup.decodeColor(value));
float hrWidth = 1; if (width != null) { float tmpWidth = Markup.parseLength(width, Markup.DEFAULT_FONT_SIZE); if (tmpWidth > 0) hrWidth = tmpWidth; if (!width.endsWith("%")) float hrSize = 1; if (size != null) { float tmpSize = Markup.parseLength(size, Markup.DEFAULT_FONT_SIZE); if (tmpSize > 0) hrSize = tmpSize; if (after != null) img.setSpacingAfter(Float.parseFloat(after)); float actualFontSize = Markup.parseLength(cprops .getProperty(ElementTags.SIZE), Markup.DEFAULT_FONT_SIZE); if (actualFontSize <= 0f) actualFontSize = Markup.DEFAULT_FONT_SIZE; float widthInPoints = Markup.parseLength(width, actualFontSize); float heightInPoints = Markup.parseLength(height, actualFontSize); if (widthInPoints > 0 && heightInPoints > 0) {
if (style == null) return; Properties prop = Markup.parseAttributes(style); for (Iterator it = prop.keySet().iterator(); it.hasNext();) { String key = (String) it.next(); h.put(ElementTags.FACE, prop.getProperty(key)); } else if (key.equals(Markup.CSS_KEY_FONTSIZE)) { float actualFontSize = Markup.parseLength(cprops .getProperty(ElementTags.SIZE), Markup.DEFAULT_FONT_SIZE); if (actualFontSize <= 0f) actualFontSize = Markup.DEFAULT_FONT_SIZE; h.put(ElementTags.SIZE, Markup.parseLength(prop .getProperty(key), actualFontSize) + "pt"); h.put("u", null); } else if (key.equals(Markup.CSS_KEY_COLOR)) { Color c = Markup.decodeColor(prop.getProperty(key)); if (c != null) { int hh = c.getRGB(); float actualFontSize = Markup.parseLength(cprops .getProperty(ElementTags.SIZE), Markup.DEFAULT_FONT_SIZE); if (actualFontSize <= 0f) actualFontSize = Markup.DEFAULT_FONT_SIZE; float v = Markup.parseLength(prop.getProperty(key),
rect.setBorderColor(new Color(red, green, blue)); } else { rect.setBorderColor(Markup.decodeColor(attributes .getProperty(ElementTags.BORDERCOLOR))); rect.setBackgroundColor(new Color(red, green, blue)); } else if (value != null) { rect.setBackgroundColor(Markup.decodeColor(value)); } else { value = attributes.getProperty(ElementTags.GRAYFILL);
String value = attributes.getProperty(Markup.HTML_ATTR_STYLE); if (value != null && value.length() > 0) { Properties styleAttributes = Markup.parseAttributes(value); if (styleAttributes.isEmpty()) { attributes.put(Markup.HTML_ATTR_STYLE, value); size = Markup.parseLength(value); color = Markup.decodeColor(value); size = Markup.parseLength(value); color = Markup.decodeColor(value);