Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 04-21-2012, 05:27 AM   #1
techsp123
Junior Member
techsp123 began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Apr 2012
Device: none
Thumbs down 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 !!!
techsp123 is offline   Reply With Quote
Old 07-13-2012, 10:47 AM   #2
bradtheissen
Junior Member
bradtheissen began at the beginning.
 
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.
bradtheissen is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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 PDF 5 07-05-2009 10:50 PM
Free Ebook on Kindle: Wild's Call koland Deals, Freebies, and Resources (No Self-Promotion) 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


All times are GMT -4. The time now is 01:38 PM.


MobileRead.com is a privately owned, operated and funded community.