html - PDF 内容重叠

标签 html css pdf flying-saucer

我看了很多帖子,但找不到合适的解决方案。如果您在 POM.xml 中使用了 Flying Saucer 9,这就是 PDF 的问题。可以用css解决吗?

尝试了很多,但在 HTML 中无法正常工作。

<div style="overflow-x:auto; width:90%; margin: 0 auto" id="Group16882">
<div class="caption">
   <br>Instructions
</div>
<table border="1" width="100%" align="center" cellpadding="2" cellspacing="1" summary="Instruction" class="generaltable" style="position:static">
    <tr>
        <td valign="top" colspan="1" rowspan="2" class="edit">
           <span style="font-size: 20; color:blue; " id=C ol197626>
             <b>
                 The 50 States, District of Columbia, and the
                  Commonwealth of Puerto Rico and other 
                   territories a Modernizas report is not 
                   considered to be confidential.
               <br>
             </b>
           </span>
        </td>
    </tr>
</table>
</div>

<div style="overflow-x:auto; width:90%; margin: 0 auto" id="Group16883">
<div class="caption"></div>
<table border="1" width="100%" align="center" cellpadding="2" cellspacing="1" summary="Estimated Figures" class="generaltable" style="position:static">
    <tr>
        <td valign="top" colspan="2" rowspan="1" class="edit">
            <span id=C ol197627><b>
           </a> Click 

               <a ref="http://www.acf.hhs.gov/programs/ocs/resource/funding- 
                  applications" target="_blank">HERE</a>
              to read the expandctions.
           <br><br>
           <A>
          </b>
       </td>
    </tr>
   <tr>
      <td valign="top"  colspan = "1" rowspan = "1" width = "74%" class="edit">
        <span id = Col197628>
           <b>
              </A>
                   Do the data below  figures?<br>
                  If YEpf assistance that has 
                  at least one estimated data entry.
               <A>
           </b>
      </td>

      <td valign="top"  colspan = "1" rowspan = "1" width = "26%" class="edit">
        <span id = Col197629><b></A>Select One<A><br></b>&nbsp;
 <img src="file:/C:/apache-tomcat-8.5.24/webapps/oldcwb/WEB-INF/classes/acf/oldc/ws/images/radiounchecked.gif"  alt="No">

           &nbsp;Yes&nbsp;&nbsp;&nbsp;

           <img src="file:/C:/apache-tomcat-8.5.24/webapps/oldcwb/WEB-INF/classes/acf/oldc/ws/images/radiounchecked.gif"  alt="No">

           &nbsp;No&nbsp;&nbsp;
        </span>
      </td>
    </tr>
</table>
</div>
enter image description here

最佳答案

html 可以先做一些修复,

<div style="overflow-x:auto; width:90%; margin: 0 auto" id="Group16882">
    <div class="caption">
        <br>Instructions <!-- br should be self closing-->
    </div>

    <table border="1" width="100%" align="center" cellpadding="2" cellspacing="1" 
          summary="Instruction" class="generaltable" style="position:static">
        <tr>
            <td valign="top" colspan="1" rowspan="2" class="edit">
               <span style="font-size: 20; color:blue; " id=C ol197626> <!-- id is not in quotes-->
                 <b>
                     The 50 States, District of Columbia, and the
                      Commonwealth of Puerto Rico and other 
                       territories a Modernizas report is not 
                       considered to be confidential.
                   <br> <!-- should be self closing-->
                 </b>
               </span>
            </td>
        </tr>
    </table>
</div>

<div style="overflow-x:auto; width:90%; margin: 0 auto" id="Group16883">
    <div class="caption"></div>

    <table border="1" width="100%" align="center" cellpadding="2" cellspacing="1" 
            summary="Estimated Figures" class="generaltable" style="position:static">
        <tr>
            <td valign="top" colspan="2" rowspan="1" class="edit">
                <span id=C ol197627> <!-- id is not in quotes where is the close of span-->
                    <b>
                        </a> Click <!-- this is a end and should be a start also you have double wrapoped the a which should not be done. (anchor anchor double anchor does not make much sense)-->

                           <a ref="http://www.acf.hhs.gov/programs/ocs/resource/funding- 
                              applications" target="_blank">HERE</a>
                            to read the expandctions.
                            <br><br>
                        <A> <!-- should be lower case and should be an end, see above-->
                </b>
           </td>
        </tr>

       <tr>
          <td valign="top"  colspan = "1" rowspan = "1" width = "74%" class="edit">
            <span id = Col197628> <!-- id is not in quotes  where is the close of span-->
               <b>
                  </A> <!-- should be lower case, a start not an end-->
                       Do the data below  figures?<br>
                      If YEpf assistance that has 
                      at least one estimated data entry.
                   <A> <!-- should be lower case should be a end and not a start-->
               </b>
          </td>

          <td valign="top"  colspan = "1" rowspan = "1" width = "26%" class="edit">
            <span id = Col197629> <!-- id is not in quotes-->
                <b>
                    </A>Select One<A> <!-- tag start and end switched-->
                    <br>
                </b>
                &nbsp;

                <img src="file:/C:/apache-tomcat-8.5.24/webapps/oldcwb/WEB-INF/classes/acf/oldc/ws/images/radiounchecked.gif"  alt="No">

                &nbsp;Yes&nbsp;&nbsp;&nbsp;

                <img src="file:/C:/apache-tomcat-8.5.24/webapps/oldcwb/WEB-INF/classes/acf/oldc/ws/images/radiounchecked.gif"  alt="No">

                &nbsp;No&nbsp;&nbsp;
            </span>
          </td>
        </tr>
    </table>
</div>

关于html - PDF 内容重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57715545/

相关文章:

html - 具有不同高度和宽度的 CSS Sprites

PDF 提交表单按钮 Safari

javascript - 通过前一个复选框更改文本框值

javascript - 避免在单击链接时插入换行符

javascript - Google Swiffy iPad 按钮双击问题

javascript - jQuery each - 第一个变量在(某些)刷新时没有获得宽度值

php - 如何正确使用laravel-dompdf生成view的pdf

c# - MVC ControllerContext、线程/任务、Rotativa

javascript - 如何使可编辑的文本区域文本不可选择

html - 将图像添加到选择标签