Open pdf File in fpdf and return ist content
is there any way, to ope a pdf file in fpdf and return its content? This is my current code:
$pdf=new FPDF();
$pdf->Open();
var_dump($pdf);
The var_dump() cu开发者_C百科rrently returns only document properties.
In case you want to create a preview image of your PDF file, download Ghostscript and ImageMagick. Install them as they are needed to create images. By the way, these applications may already be installed on your system (so check first).
Use the following PHP code to create preview images (200px wide) for all pages of your PDF file.
exec('convert "document.pdf" -colorspace RGB -geometry 200 "document.png"');
If you only want to create one preview image, use the following code. You may replace the number inside the square brackets by the desired page number starting at 0.
exec('convert "document.pdf[0]" -colorspace RGB -geometry 200 "document.png"');
精彩评论