04-21-2012, 05:27 AM | #1 |
Junior Member
Posts: 1
Karma: 10
Join Date: Apr 2012
Device: none
|
Call ebook-convert from PHP using exec/shell_exec
Hi,
I am using Fedora 14 and clibre installation is working and also i can execute "ebook-convert" (version: calibre 0.8.47) from the command line. I was trying to convert .pdf to .epub using a PHP file by calling exec/shell_exec. But i get some error ----------- ######################################### Traceback (most recent call last): File "site.py", line 56, in main File "site-packages/calibre/__init__.py", line 21, in File "site-packages/calibre/startup.py", line 65, in File "site-packages/calibre/utils/localization.py", line 70, in set_translators File "site-packages/calibre/utils/localization.py", line 27, in get_lang File "site-packages/calibre/utils/config_base.py", line 432, in File "site-packages/calibre/utils/config_base.py", line 352, in __setitem__ File "site-packages/calibre/utils/config_base.py", line 366, in set File "site-packages/calibre/utils/config_base.py", line 298, in set File "site-packages/calibre/utils/lock.py", line 113, in __enter__ IOError: [Errno 20] Not a directory: '/var/www/.config/calibre/global.py' /calibre/calibre/lib/python2.7/site-packages/calibre/ptempfile.py:27: RuntimeWarning: Parent module 'calibre' not found while handling absolute import /var/www/html/tictlive/temp/j17 ######################################### My php code is: (test.php under /var/www/html/tictlive/temp/j17 directory). and the source file "Bengal_Institute_Documents.pdf" is under directory "dmdocuments" under "j17/" directory. $infile = "Bengal_Institute_Documents.pdf"; $infile2 = "dmdocuments/".$infile; $comm1="ebook-convert ".$infile2." a.epub 2>&1"; $r1 = shell_exec($comm1); echo $comm1."</br>".$r1; Can any one help !!! |
07-13-2012, 10:47 AM | #2 |
Junior Member
Posts: 1
Karma: 10
Join Date: Jul 2012
Device: none
|
I want to make an .ePub file from a directory of .jpegs on my web server, using PHP.
I think your experience stated above gives me hope! I like Sigil for OSX, however, adding 50 jpegs is 50 clicks! And remembering the last one you clicked to add! I'd like to have Sigil for Linux create the all the xml files and zip archive based on the directory of 50 jpegs in question. Have you done this? As an author, I use all of the OSX eBook readers. For hardware, I have iPad (3) and iPhone4. |
Advert | |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
suggestion: optionally call an editor during convert ? | jojoax | Calibre | 2 | 04-17-2012 11:26 AM |
Running ebook-convert from php | conryf | Calibre | 7 | 05-24-2010 05:24 AM |
Using PHP to convert PDFs | joedevon | 5 | 07-05-2009 10:50 PM | |
Free Ebook on Kindle: Wild's Call | koland | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 03-17-2009 08:32 AM |
A Call to All Ebook Contributors: Let's Get MobileRead's Ebooks Categorized | Dr. Drib | News | 10 | 12-13-2008 03:02 PM |