Sunday 15 July 2012

php - Can one convert pdf to swf dynamically? -


Can you dynamically convert PDF into SWF? I am trying, but it proved to be difficult.

This is my code:

  & lt ;? Includes php ('include \ settings.php'); $ Title = "k"; $ Makes wf = mysql_query ("books select WHERE title = 'title $'); $ Rows = mysql_num_rows (makes $); If ($ rows! = 0) {while ($ rows = mysql_fetch_assoc ($ makewf)) {// Where there is a radius, the pdf file needs to be changed $ file = $ rows ['ejected']; Echo exec ('D: \ wamp \ www \ dspzlibrary \ converter \ pdf2swf.exe books \ $ file.pdf -o books \ $ file.swf -f -T 9 -t -s storeallcharacters'); }} Else "empty" echo; ? & Gt;   

And here is the error I got:

error books \ $ file.pdf could not open

any Also assistance will be appreciated.

The error message is telling you what is happening. Executable pdf2swf.exe is trying to open $ file.pdf instead of the actual filename.

In PHP you need double quote "" for inline variable replacement.

  echo exec ("D: \ wamp \ www \ dspzlibrary \ converter \ pdf2swf.exe books \ $ file.pdf -o books \ $ file.swf -f-9-t- S Retailers "); See   

:

The most important feature of double-quoted strings is that variable names will be expanded.

No comments:

Post a Comment