dsz90288 2015-12-22 17:39
浏览 112

Acrobat渲染bug与TCPDF中的复选框

I use TCPDF for a dynamic form that gets generated from a table using mysql and php. I've been using it for some time now without issue, but lately I've noticed a rendering issue that is bugging me. At first I thought it was something in my code, but now I don't think so, and either believe it an issue with TCPDF or with acrobat...I'm leaning towards the later.

Here is what the form looks like in the browser(the section in question): http://i67.tinypic.com/29c9j4x.png

and here is what the same PDF, downloaded and opened in Acrobat DC/Reader XI looks like: http://i68.tinypic.com/epqao9.png

This section is defined via the following code:

switch ((int)$appflags) 
{
case 0:
    $left_column = '<input type="checkbox" name="box" value="1" readonly="true" /> Shredding/Pulverizing<br><input type="checkbox" name="box" value="1" readonly="true" /> DoD 5220.22-M<br><input type="checkbox" name="box" value="1" readonly="true" /> Deleting';
    break;

case 1:
    $left_column = '<input type="checkbox" name="box" value="1" checked="checked" readonly="true" /> Shredding/Pulverizing<br><input type="checkbox" name="box" value="1" readonly="true" /> DoD 5220.22-M<br><input type="checkbox" name="box" value="1" readonly="true" /> Deleting';
    break;

case 2:
    $left_column = '<input type="checkbox" name="box" value="1" readonly="true" /> Shredding/Pulverizing<br><input type="checkbox" name="box" value="1" checked="checked" readonly="true" /> DoD 5220.22-M<br><input type="checkbox" name="box" value="1" readonly="true" /> Deleting';
    break;

case 3:
    $left_column = '<input type="checkbox" name="box" value="1" checked="checked" readonly="true" /> Shredding/Pulverizing<br><input type="checkbox" name="box" value="1" checked="checked" readonly="true" /> Dod 5220.22-M<br><input type="checkbox" name="box" value="1" readonly="true" /> Deleting';
    break;

case 4:
    $left_column = '<input type="checkbox" name="box" value="1" readonly="true" /> Shredding/Pulverizing<br><input type="checkbox" name="box" value="1" readonly="true" /> Dod 5220.22-M<br><input type="checkbox" name="box" value="1" checked="checked" readonly="true" /> Deleting';
    break;

case 5:
    $left_column = '<input type="checkbox" name="box" value="1" checked="checked" readonly="true" /> Shredding/Pulverizing<br><input type="checkbox" name="box" value="1" readonly="true" /> Dod 5220.22-M<br><input type="checkbox" name="box" value="1" checked="checked" readonly="true" /> Deleting';
    break;

case 6:
    $left_column = '<input type="checkbox" name="box" value="1" readonly="true" /> Shredding/Pulverizing<br><input type="checkbox" name="box" value="1" checked="checked" readonly="true" /> Dod 5220.22-M<br><input type="checkbox" name="box" value="1" checked="checked" readonly="true" /> Deleting';
    break;

case 7:
    $left_column = '<input type="checkbox" name="box" value="1" checked="checked" readonly="true" /> Shredding/Pulverizing<br><input type="checkbox" name="box" value="1" checked="checked" readonly="true" /> Dod 5220.22-M<br><input type="checkbox" name="box" value="1" checked="checked" readonly="true" /> Deleting';
    break;
}


$pdf->writeHTMLCell(60, '', 24, 165, $left_column, 0, 0, 0, true, 'J', true);
$pdf->writeHTMLCell(60, '', 124, 165, $right_column, 0, 2, 0, true, 'J', true);

Same code, same pdf, but when downloaded and opened in DC (latest acrobat version 2015.009.20079) there is a difference in checkbox rendering. I uninstalled Acrobat DC, went back and installed Adobe Reader XI, same issue. I then forwarded one of these PDFs to my Phone, opened it there...everything works.

So it works on my Android device, it works in Chrome, only doesn't work in Desktop readers. Is this a problem with Acrobat Reader, or is it something with the writehtml code?

  • 写回答

1条回答 默认 最新

  • douren2831 2015-12-22 17:47
    关注

    Just downloaded NitroPDF, document renders fine. I'm chalking this one up to a problem in Adobe's software.

    评论

报告相同问题?

悬赏问题

  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示