Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/393.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JAVA Openhtmltopdf(flyingsource)库为什么文本对齐对齐不起作用?_Java_Css_Pdf Generation_Tidy_Openhtmltopdf - Fatal编程技术网

JAVA Openhtmltopdf(flyingsource)库为什么文本对齐对齐不起作用?

JAVA Openhtmltopdf(flyingsource)库为什么文本对齐对齐不起作用?,java,css,pdf-generation,tidy,openhtmltopdf,Java,Css,Pdf Generation,Tidy,Openhtmltopdf,下面是由Tidy库生成的内容,pdf显示不正确,openhtmltopdf库不支持吗?或者Tidy提供的内容是错误的?请帮助我的星期 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

下面是由Tidy库生成的内容,pdf显示不正确,openhtmltopdf库不支持吗?或者Tidy提供的内容是错误的?请帮助我的星期

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta name="generator"
content="HTML Tidy for Java (vers. 2009-12-01), see jtidy.sourceforge.net" /><style
 type="text/css">
/*<![CDATA[*/
p {
  text-align: justify;
  text-justify: inter-word;
}
/*]]>*/
</style>
    <title>
    </title>
  </head>
  <body>
    <p style="text-align: justify;">
      this is my text, this is my text, this is my text, this is my text, 
      this is my text, this is my text, this is my text, this is my text, 
      this is my text, this is my text, 
      this is my text, this is my text, this is my text, this is my text, 
      this is my text, this is my text, 
      this is my text, this is my text.
    </p>
  </body>
</html>

/**/

这是我的文本,这是我的文本,这是我的文本,这是我的文本, 这是我的文本,这是我的文本,这是我的文本,这是我的文本, 这是我的文本,这是我的文本, 这是我的文本,这是我的文本,这是我的文本,这是我的文本, 这是我的文本,这是我的文本, 这是我的文本,这是我的文本。


不是因为没有包含换行符吗?在这种情况下,无论源有多破碎,渲染时都会将其解释为好像是同一条线。您必须使用标签来断开:

<p style="text-align: justify;">
  this is my text, this is my text, this is my text, this is my text, <br/>
  this is my text, this is my text, this is my text, this is my text, <br/>
  this is my text, this is my text, <br/>
  this is my text, this is my text, this is my text, this is my text, <br/>
  this is my text, this is my text, <br/>
  this is my text, this is my text.
</p>

这是我的文本,这是我的文本,这是我的文本,这是我的文本,
这是我的文本,这是我的文本,这是我的文本,这是我的文本,
这是我的文本,这是我的文本,
这是我的文本,这是我的文本,这是我的文本,这是我的文本,
这是我的文本,这是我的文本,
这是我的文本,这是我的文本。