HTML2PDF和api.qrserver.com错误号码6

时间:2014-06-13 11:27:45

标签: php qr-code html2pdf

我试图在其中输出带有qrCode图像的pdf。 我使用api.qrserver.com创建图像,使用HTML2PDF创建pdf。 这是我的PHP代码:

    $pre_path = 'http://m.website.fr/';
    $path = $pre_path . drupal_lookup_path('alias', "node/" . $_GET['nid']);
    require(drupal_get_path('module', 'pdfcreator') . '/libs/html2pdf_v4.03/html2pdf.class.php');


    ob_clean();

    ob_start();
    require(drupal_get_path('module', 'qrcode') . '/templates/pdf.tpl.php');

    $content = ob_get_clean();
    try {
        $html2pdf = new HTML2PDF('P', 'A4', 'fr');
       // $html2pdf->setTestIsImage(false);
        $html2pdf->WriteHTML($content);

        $html2pdf->Output($fields['ref'] . date('ymd') . '.pdf', 'D');
    } catch (HTML2PDF_exception $e) {
        echo $e;
        exit;
    }

我的模板pdf.tpl.php包含

<table>
    <tr>
        <td><img src="https://api.qrserver.com/v1/create-qr-code/?format=gif&data=<?php echo urlencode($path) ?>"/></td>
    </tr>
</table>

不使用html2pdf,图像生成就好了。但是当我使用HTML2PDF时,我收到了

错误6:无法加载图片https://api.qrserver.com/v1/create-qr-code/?format=gif&data=http%3A%2F%2Fm.website.fr%2Ffoo%2Fstuff

有什么不对?

1 个答案:

答案 0 :(得分:0)

问题是https://

中的“s”
相关问题