Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 能否将pdf动态转换为swf?_Php_File_Pdf_Flash_Converter - Fatal编程技术网

Php 能否将pdf动态转换为swf?

Php 能否将pdf动态转换为swf?,php,file,pdf,flash,converter,Php,File,Pdf,Flash,Converter,能否将PDF动态转换为SWF?我一直在努力,但结果证明很难 这是我的密码: <?php include('include\settings.php'); $title = "k"; $makeswf= mysql_query("SELECT * FROM books WHERE title = '$title'"); $rows = mysql_num_rows($makeswf); if ($rows !=0) { while($rows = mysql_fetch_assoc($m

能否将PDF动态转换为SWF?我一直在努力,但结果证明很难

这是我的密码:

<?php
include('include\settings.php');

$title = "k";
$makeswf= mysql_query("SELECT * FROM books WHERE title = '$title'");
$rows = mysql_num_rows($makeswf);

if ($rows !=0)
{
while($rows = mysql_fetch_assoc($makeswf))
{

//where blocation is the pdf file need to be converted.

$file = $rows['blocation'];

echo exec('D:\wamp\www\dspzlibrary\converter\pdf2swf.exe books\$file.pdf -o books\$file.swf -f -T 9 -t -s storeallcharacters');
}

  }

else
echo"empty";

?>

错误消息告诉您发生了什么。可执行文件pdf2swf.exe
试图打开的是
$file.pdf
,而不是实际的文件名

在PHP中,内联变量替换需要双引号“”

echo exec("D:\wamp\www\dspzlibrary\converter\pdf2swf.exe books\$file.pdf -o books\$file.swf -f -T 9 -t -s storeallcharacters");
见:

双引号字符串最重要的特性是变量名将被扩展


“这是代码”-我想你可能忘了在那里发布代码。代码的格式不是这样的。php标记导致它被忽略显示。在“”双引号之后,现在仍然没有锁定