pdfcrowd转换器将php文件转换为空白pdf

pdfcrowd转换器将php文件转换为空白pdf,php,pdf-generation,Php,Pdf Generation,我使用pdfcrowd将php文件转换为pdf,但它会转换为空白pdf。可能是什么问题?pdfcrowd是否转换php文件 代码在这里 <?php require 'pdfcrowd.php'; try { $client = new Pdfcrowd("nabinashahi", "2ef55554fe4c2d23b52b8e080cac867g");// create an API client instance // $pdf = $client

我使用pdfcrowd将php文件转换为pdf,但它会转换为空白pdf。可能是什么问题?pdfcrowd是否转换php文件

代码在这里

<?php
    require 'pdfcrowd.php';

try
{   

    $client = new Pdfcrowd("nabinashahi", "2ef55554fe4c2d23b52b8e080cac867g");// create an API client instance


    // $pdf = $client->convertURI('http://www.google.com/');
    $pdf = $client->convertFile("C:/xampp/htdocs/pdf/page.php");// convert a web page and store the generated PDF into a $pdf variable

    // set HTTP response headers
    header("Content-Type: application/pdf");
    header("Cache-Control: no-cache");
    header("Accept-Ranges: none");
    header("Content-Disposition: attachment; filename=\"google_com.pdf\"");


    echo $pdf;// send the generated PDF 
}
catch(PdfcrowdException $why)
{
    echo "Pdfcrowd Error: " . $why;
}
?>

我认为问题在于您没有转换php文件生成的输出,而是转换实际的php文件本身。pdfCrowd能够将HTML转换为pdf格式-我认为他们处理php源代码的能力不太好,我也不认为这是您想要做的:-)