PDFLib TET PHP:无法提取图像

PDFLib TET PHP:无法提取图像,php,pdf,pdflib,Php,Pdf,Pdflib,我能够在Windows8.1+Xampp上安装TET(php_-TET.dll),并且我在PDF到文本方面没有问题,但是我在图像提取方面没有运气 我正在使用示例“image resources.php”(和“image_extractor.php”),它应该在PDF文件中“打印”一些关于图像的信息(x、y、宽度、高度、alpha和e.t.c)。还必须将所有可用(或任何)图像保存/提取到文件(tiff、jpg)中 示例可在此处找到: 具有图像信息的部件正在工作,但未提取任何文件 我在同一个文件夹中

我能够在Windows8.1+Xampp上安装TET(php_-TET.dll),并且我在PDF到文本方面没有问题,但是我在图像提取方面没有运气

我正在使用示例“image resources.php”(和“image_extractor.php”),它应该在PDF文件中“打印”一些关于图像的信息(x、y、宽度、高度、alpha和e.t.c)。还必须将所有可用(或任何)图像保存/提取到文件(tiff、jpg)中

示例可在此处找到:

具有图像信息的部件正在工作,但未提取任何文件

我在同一个文件夹中将文本提取到TXT文件时没有遇到任何问题。 所以我能在那里写作

我的搜索路径有问题吗?

我的尝试:

原始示例抛出错误:

Error 1016 in open_document(): Couldn't open PDF file 'FontReporter.pdf' for reading (file not found)
所以我改变了搜索路径:

/* global option list */
$globaloptlist = "searchpath={{../data} {../../data} }";
使用我的pdf文件的位置:

/* global option list */
$globaloptlist = "searchpath={{D:\Workshop\www\TET\data} }";
现在,我通过打印/回显获得了一些输出数据:

page 7: 208x277pt, alpha=0, beta=0 id=0, 595x750 pixel, 1x8 bit Indexed 
page 7: 208x277pt, alpha=0, beta=0 id=1, 595x750 pixel, 1x8 bit Indexed
$tet->write_image_file方法返回10,表示“我可以提取TIFF文件”


但是在我的pdf文件夹或周围的任何地方都没有提取图像…

不知何故,这些图像是在D:\workshop\xampp\apache中导出的

在选项FILENAME中,我需要设置绝对路径和文件名

$path = str_replace('\\', '/', __DIR__);

$imageoptlist = $baseimageoptlist . " filename {".$path."/out/" .
    $outfilebase . "_p" . $pageno . "_I" . $ti->imageid . "}";

    if ($tet->write_image_file($doc, $ti->imageid, $imageoptlist) == 0){
       print("Error " . $tet->get_errnum() . " in " .
          $tet->get_apiname() . "(): " . $tet->get_errmsg());
 }

这正是我在TET手册中发现的(第3.9章“PHP”部分):


因此,我想,您可能需要根据自己的需要稍微调整示例。

这有点奇怪,因为当我保存文本(从pdf中提取文本)文件时,没有任何路径,该文件是在与PHP文件相同的目录中创建的,但如果图像没有路径,我会在apache文件夹中找到它们。。。但是我的DLL在/PHP/ext/中,它不在apache文件夹中。毕竟,谢谢!
File name handling in PHP 
Unqualified file names (without any path component) and relative file names are 
handled differently in Unix and Windows versions of PHP:
- PHP on Unix systems will find files without any path component in the directory
  where the script is located.
- PHP on Windows will find files without any path component only in the directory
  where the PHP DLL is located.