dpmrakfbx820320638 2017-04-17 04:35
浏览 45

分析生成pdf的php代码

I am viewing a php code that generate pdf on browser, code is working perfectly but I can't able to understand the meaning behind the following statement...

$page_format = array(
   'MediaBox' => array ('llx' => 0, 'lly' => 0, 'urx' => 210, 'ury' => 210),
   'Dur' => 3,
   'trans' => array(
   'D' => 1.5,
   'S' => 'Split',
   'Dm' => 'V',
   'M' => 'O'
   ),
   'Rotate' => 0,
   'PZ' => 1,
);
$pdf->AddPage('P', $page_format, false, false);

If any one know about it, kindly help me out.

  • 写回答

1条回答 默认 最新

  • doulu5717 2017-04-17 05:15
    关注

    This creates an associative array whose first key is the single-quoted literal string 'MediaBox' whose value is an associative array whose first key is the single-quoted literal string 'llx' whose value is the decimal integer literal 0, whose second key is the single-quoted literal string 'lly' whose value is the decimal integer literal 0, whose third key is the single-quoted literal string 'urx' whose value is the decimal integer literal 210, and whose fourth key is the single-quoted literal string 'ury' whose value is the decimal integer literal 210.

    The second key of the outer associative array is the single-quoted literal string 'Dur' which is associated with the decimal integer literal 3, the third key is the single-quoted literal string 'trans' which is associated with an associative array whose first key is the single-quoted literal string 'D' which is associated with the decimal floating point number literal 1.5, the second is the single-quoted literal string 'S' which is associated with the single-quoted literal string 'Split', the third key is the single-quoted literal string Dm which is associated with the single-quoted literal string 'V', the fourth key is the single-quoted literal string 'M' which is associated with the single-quoted literal string 'O'.

    The fourth key of the outer array is the single-quoted literal string 'Rotate' which is associated with the decimal integer literal 0, and the fifth key is the single-quoted literal string 'PZ' which is associated with the decimal integer literal 1. This associative array is then bound to a variable called $page_format.

    The last line dereferences a variable called $pdf and calls the AddPage method of the object whose reference is stored in that variable, passing the single-quoted literal string 'P' as the first argument, the associative array whose reference is stored in the $page_format variable as the second argument, the boolean literal false as the third argument, and the boolean literal false as the fourth argument.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度