duanhao7786 2013-10-21 07:54
浏览 77

王子xml似乎不起作用

Ive created a test page to test using Prince xml but this code doesn't seem to work.

index.php

require_once("prince.php");

$prince = new Prince('www1.must.edu.ph/tts/prince/Engine/bin/prince.exe');
$prince->setHTML(true);

$html = file_get_contents("reportHeader.html");

$ret = $prince->convert_string_to_file($html,'www1.must.edu.ph/tts/prince/Engine/bin/pink.pdf');

echo $html;

if($ret)
echo "converted";
else
echo "not";

whenever I access the page, there is no error.. it just displays the echoed $html and 'not'..

  • 写回答

3条回答 默认 最新

  • douzhou7656 2013-10-21 07:59
    关注

    Problem 1:

    I spotted the problem. You run PHP code in an .html ? Change the file extension to .php and re-upload to PHP-enabled hosting server & retry.

    Problem 2:

    The constructor does not set correctly. The constructor requires an absolute path on server, instead of an URL. The readme.html already mentioned this. It should look like:

    $prince = new Prince('/usr/local/bin/prince');
    

    In read me, it said:

    On Windows, be sure to specify the path to the prince.exe file located within the Engine\bin subfolder of the Prince installation.

    Note: Most of the PHP-enabled hosting server are NOT Windows-based; even it's Windows-based, it won't allow you to execute .exe .

    评论

报告相同问题?

悬赏问题

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