PDF Input: calibre now supports conversion of PDF version > 1.5 as well

This commit is contained in:
Kovid Goyal 2009-04-23 20:57:37 -07:00
parent f626ae0270
commit 075f59b8d1
7 changed files with 21 additions and 15 deletions

View File

@ -246,7 +246,9 @@ _check_symlinks_prescript()
print
print 'Adding pdftohtml'
os.link(os.path.expanduser('~/pdftohtml'), os.path.join(frameworks_dir, 'pdftohtml'))
os.link(os.path.expanduser('~/pdftohtml/pdftohtml'), os.path.join(frameworks_dir, 'pdftohtml'))
os.link(os.path.expanduser('~/pdftohtml/libpoppler.4.dylib'),
os.path.join(frameworks_dir, 'libpoppler.4.dylib'))
print 'Adding plugins'
module_dir = os.path.join(resource_dir, 'lib', 'python2.6', 'lib-dynload')
print 'Adding fontconfig'

View File

@ -9,7 +9,7 @@ Freeze app into executable using py2exe.
QT_DIR = 'C:\\Qt\\4.4.3'
LIBUSB_DIR = 'C:\\libusb'
LIBUNRAR = 'C:\\Program Files\\UnrarDLL\\unrar.dll'
PDFTOHTML = 'C:\\pdftohtml\\pdftohtml.exe'
PDFTOHTML = 'C:\\cygwin\\home\\kovid\\poppler-0.10.6\\rel\\pdftohtml.exe'
IMAGEMAGICK_DIR = 'C:\\ImageMagick'
FONTCONFIG_DIR = 'C:\\fontconfig'
VC90 = r'C:\VC90.CRT'
@ -98,6 +98,8 @@ class BuildEXE(py2exe.build_exe.py2exe):
shutil.copyfile(LIBUNRAR, os.path.join(PY2EXE_DIR, os.path.basename(LIBUNRAR)))
print '\tAdding pdftohtml'
shutil.copyfile(PDFTOHTML, os.path.join(PY2EXE_DIR, os.path.basename(PDFTOHTML)))
shutil.copyfile(PDFTOHTML+'.manifest', os.path.join(PY2EXE_DIR,
os.path.basename(PDFTOHTML)+'.manifest'))
print '\tAdding ImageMagick'
for f in os.listdir(IMAGEMAGICK_DIR):
shutil.copyfile(os.path.join(IMAGEMAGICK_DIR, f), os.path.join(PY2EXE_DIR, f))

View File

@ -17,10 +17,10 @@ def option_parser():
Run an embedded python interpreter.
''')
parser.add_option('--update-module',
parser.add_option('-u', '--update-module', default=False,
action='store_true',
help='Update the specified module in the frozen library. '+
'Module specifications are of the form full.name.of.module,path_to_module.py',
default=None
'Module specifications are of the form full.name.of.module path_to_module.py',
)
parser.add_option('-c', '--command', help='Run python code.', default=None)
parser.add_option('-e', '--exec-file', default=None, help='Run the python code in file.')
@ -143,7 +143,7 @@ def main(args=sys.argv):
from calibre.gui2.main import main
main(['calibre'])
elif opts.update_module:
mod, path = opts.update_module.partition(',')[0], opts.update_module.partition(',')[-1]
mod, path = args[1:3]
update_module(mod, os.path.expanduser(path))
elif opts.command:
sys.argv = args[:1]

View File

@ -36,7 +36,8 @@ def generate_html(pathtopdf, tdir):
index = os.path.join(tdir, 'index.html')
# This is neccessary as pdftohtml doesn't always (linux) respect absolute paths
pathtopdf = os.path.abspath(pathtopdf)
cmd = (PDFTOHTML, '-enc', 'UTF-8', '-noframes', '-p', '-nomerge', pathtopdf, os.path.basename(index))
cmd = (PDFTOHTML, '-enc', 'UTF-8', '-noframes', '-p', '-nomerge',
'-nodrm', pathtopdf, os.path.basename(index))
cwd = os.getcwd()
try:

View File

@ -96,12 +96,12 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
self.viewers = collections.deque()
self.content_server = None
self.system_tray_icon = QSystemTrayIcon(QIcon(':/library'), self)
self.system_tray_icon.setObjectName('calibre')
self.system_tray_icon.setToolTip('calibre')
if not config['systray_icon']:
self.system_tray_icon.hide()
else:
self.system_tray_icon.show()
self.system_tray_menu = QMenu()
self.system_tray_menu = QMenu(self)
self.restore_action = self.system_tray_menu.addAction(
QIcon(':/images/page.svg'), _('&Restore'))
self.donate_action = self.system_tray_menu.addAction(

View File

@ -93,7 +93,7 @@ def options(option_parser):
def opts_and_words(name, op, words):
opts = '|'.join(options(op))
words = '|'.join([w.replace("'", "\\'") for w in words])
return '_'+name+'()'+\
return ('_'+name+'()'+\
'''
{
local cur opts
@ -117,7 +117,7 @@ def opts_and_words(name, op, words):
esac
}
complete -F _'''%(opts, words) + name + ' ' + name +"\n\n"
complete -F _'''%(opts, words) + name + ' ' + name +"\n\n").encode('utf-8')
def opts_and_exts(name, op, exts):

View File

@ -19,6 +19,7 @@ DEPENDENCIES = [
('python-dateutil', '1.4.1', 'python-dateutil', 'python-dateutil', 'python-dateutil'),
('BeautifulSoup', '3.0.5', 'beautifulsoup', 'python-beautifulsoup', 'python-BeautifulSoup'),
('dnspython', '1.6.0', 'dnspython', 'dnspython', 'dnspython', 'dnspython'),
('poppler', '0.10.5', 'poppler', 'poppler', 'poppler', 'poppler'),
]