gpt4 book ai didi

org.xhtmlrenderer.simple.extend.XhtmlNamespaceHandler类的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 00:37:05 27 4
gpt4 key购买 nike

本文整理了Java中org.xhtmlrenderer.simple.extend.XhtmlNamespaceHandler类的一些代码示例,展示了XhtmlNamespaceHandler类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XhtmlNamespaceHandler类的具体详情如下:
包路径:org.xhtmlrenderer.simple.extend.XhtmlNamespaceHandler
类名称:XhtmlNamespaceHandler

XhtmlNamespaceHandler介绍

[英]Handles xhtml documents, including presentational html attributes (see css 2.1 spec, 6.4.4). In this class ONLY handling (css equivalents) of presentational properties (according to css 2.1 spec, section 6.4.4) should be specified.
[中]处理xhtml文档,包括呈现式html属性(参见css 2.1规范6.4.4)。在这个类别中,只应指定表示属性的处理(css等价物)(根据css 2.1规范,第6.4.4节)。

代码示例

代码示例来源:origin: org.xhtmlrenderer/flying-saucer-pdf-itext5

public void setDocument(Document doc, String url) {
  setDocument(doc, url, new XhtmlNamespaceHandler());
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

public String getNonCssStyling(Element e) {
  if (e.getNodeName().equals("table")) {
    return applyTableStyles(e);            
  } else if (e.getNodeName().equals("td") || e.getNodeName().equals("th")) {
    return applyTableCellStyles(e);
  } else if (e.getNodeName().equals("tr")) {
    return applyTableRowStyles(e);
  } else if (e.getNodeName().equals("img")) {
    return applyImgStyles(e);
  } else if (e.getNodeName().equals("p") || e.getNodeName().equals("div")) {
    return applyBlockAlign(e);
  }
  return "";
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

private String applyImgStyles(Element e) {
  StringBuffer style = new StringBuffer();
  applyFloatingAlign(e, style);
  return style.toString();
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

Element table = findTable(e);
if (table != null) {
  s = getAttribute(table, "cellpadding");
  if (s != null) {
    style.append("padding: ");
    style.append(convertToLength(s));
    style.append(";");
  s = getAttribute(table, "border");
  if (s != null && ! s.equals("0")) {
    style.append("border: 1px outset black;");
s = getAttribute(e, "width");
if (s != null) {
  style.append("width: ");
  style.append(convertToLength(s));
  style.append(";");
s = getAttribute(e, "height");
if (s != null) {
  style.append("height: ");
  style.append(convertToLength(s));
  style.append(";");
applyTableContentAlign(e, style);
s = getAttribute(e, "bgcolor");
if (s != null) {
  s = s.toLowerCase();
  style.append("background-color: ");

代码示例来源:origin: org.xhtmlrenderer/core-renderer

private String applyTableStyles(Element e) {
  StringBuffer style = new StringBuffer();
  String s;
  s = getAttribute(e, "width");
  if (s != null) {
    style.append("width: ");
    style.append(convertToLength(s));
    style.append(";");
  s = getAttribute(e, "border");
  if (s != null) {
    style.append("border: ");
    style.append(convertToLength(s));
    style.append(" inset black;");
  s = getAttribute(e, "cellspacing");
  if (s != null) {
    style.append("border-collapse: separate; border-spacing: ");
    style.append(convertToLength(s));
    style.append(";");
  s = getAttribute(e, "bgcolor");
  if (s != null) {
    s = s.toLowerCase();
    style.append("background-color: ");
    if (looksLikeAMangledColor(s)) {
      style.append('#');
      style.append(s);
  s = getAttribute(e, "background");

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

private String applyTableRowStyles(Element e) {
  StringBuffer style = new StringBuffer();
  applyTableContentAlign(e, style);
  return style.toString();
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

private String applyBlockAlign(Element e) {
  StringBuffer style = new StringBuffer();
  applyTextAlign(e, style);
  return style.toString();
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

Element table = findTable(e);
if (table != null) {
  s = getAttribute(table, "cellpadding");
  if (s != null) {
    style.append("padding: ");
    style.append(convertToLength(s));
    style.append(";");
  s = getAttribute(table, "border");
  if (s != null && ! s.equals("0")) {
    style.append("border: 1px outset black;");
s = getAttribute(e, "width");
if (s != null) {
  style.append("width: ");
  style.append(convertToLength(s));
  style.append(";");
s = getAttribute(e, "height");
if (s != null) {
  style.append("height: ");
  style.append(convertToLength(s));
  style.append(";");
applyTableContentAlign(e, style);
s = getAttribute(e, "bgcolor");
if (s != null) {
  s = s.toLowerCase();
  style.append("background-color: ");

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

private String applyTableStyles(Element e) {
  StringBuffer style = new StringBuffer();
  String s;
  s = getAttribute(e, "width");
  if (s != null) {
    style.append("width: ");
    style.append(convertToLength(s));
    style.append(";");
  s = getAttribute(e, "border");
  if (s != null) {
    style.append("border: ");
    style.append(convertToLength(s));
    style.append(" inset black;");
  s = getAttribute(e, "cellspacing");
  if (s != null) {
    style.append("border-collapse: separate; border-spacing: ");
    style.append(convertToLength(s));
    style.append(";");
  s = getAttribute(e, "bgcolor");
  if (s != null) {
    s = s.toLowerCase();
    style.append("background-color: ");
    if (looksLikeAMangledColor(s)) {
      style.append('#');
      style.append(s);
  s = getAttribute(e, "background");

代码示例来源:origin: org.xhtmlrenderer/core-renderer

private String applyTableRowStyles(Element e) {
  StringBuffer style = new StringBuffer();
  applyTableContentAlign(e, style);
  return style.toString();
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

private String applyBlockAlign(Element e) {
  StringBuffer style = new StringBuffer();
  applyTextAlign(e, style);
  return style.toString();
}

代码示例来源:origin: org.xhtmlrenderer/flying-saucer-pdf-openpdf

public void setDocument(Document doc, String url) {
  setDocument(doc, url, new XhtmlNamespaceHandler());
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public String getNonCssStyling(Element e) {
  if (e.getNodeName().equals("table")) {
    return applyTableStyles(e);            
  } else if (e.getNodeName().equals("td") || e.getNodeName().equals("th")) {
    return applyTableCellStyles(e);
  } else if (e.getNodeName().equals("tr")) {
    return applyTableRowStyles(e);
  } else if (e.getNodeName().equals("img")) {
    return applyImgStyles(e);
  } else if (e.getNodeName().equals("p") || e.getNodeName().equals("div")) {
    return applyBlockAlign(e);
  }
  return "";
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

private String applyImgStyles(Element e) {
  StringBuffer style = new StringBuffer();
  applyFloatingAlign(e, style);
  return style.toString();
}

代码示例来源:origin: org.xhtmlrenderer/flying-saucer-pdf

public void setDocument(Document doc, String url) {
  setDocument(doc, url, new XhtmlNamespaceHandler());
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

public void setDocument(Document doc, String url) {
  setDocument(doc, url, new XhtmlNamespaceHandler());
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public void setDocument(Document doc, String url) {
  setDocument(doc, url, new XhtmlNamespaceHandler());
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

/**
 * Renders a Document using a URL as a base URL for relative
 * paths.
 *
 * @param doc The new document value
 * @param url The new document value
 */
public void setDocument(Document doc, String url) {
  resetListeners();
  super.setDocument(doc, url, new XhtmlNamespaceHandler());
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

/**
 * Renders a Document using a URL as a base URL for relative
 * paths.
 *
 * @param doc The new document value
 * @param url The new document value
 */
public void setDocument(Document doc, String url) {
  resetListeners();
  setDocument(doc, url, new XhtmlNamespaceHandler());
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

/**
 * Renders a Document read from an InputStream using a URL
 * as a base URL for relative paths.
 *
 * @param stream The stream to read the Document from.
 * @param url    The URL used to resolve relative path references.
 */
// TODO: should throw more specific exception (PWW 25/07/2006)
public void setDocument(InputStream stream, String url)
    throws Exception {
  resetListeners();
  setDocument(stream, url, new XhtmlNamespaceHandler());
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com