在fpdf中打开pdf文件并返回ist内容 [英] Open pdf File in fpdf and return ist content

查看:147
本文介绍了在fpdf中打开pdf文件并返回ist内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以在fpdf中操作pdf文件并返回其内容? 这是我当前的代码:

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); 

var_dump()当前仅返回文档属性.

The var_dump() currently returns only document properties.

推荐答案

如果要创建PDF文件的预览图像,请下载 ImageMagick .根据需要安装它们以创建映像.顺便说一句,这些应用程序可能已经安装在您的系统上(请先检查).

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).

使用以下PHP代码为PDF文件的所有页面创建预览图像(宽200像素).

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"');

如果只想创建一个预览图像,请使用以下代码.您可以将方括号内的数字替换为所需的页码,从0开始.

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"');

这篇关于在fpdf中打开pdf文件并返回ist内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆