mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
PDF Input: calibre now supports conversion of PDF version > 1.5 as well
This commit is contained in:
parent
f626ae0270
commit
075f59b8d1
@ -246,7 +246,9 @@ _check_symlinks_prescript()
|
|||||||
|
|
||||||
print
|
print
|
||||||
print 'Adding pdftohtml'
|
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'
|
print 'Adding plugins'
|
||||||
module_dir = os.path.join(resource_dir, 'lib', 'python2.6', 'lib-dynload')
|
module_dir = os.path.join(resource_dir, 'lib', 'python2.6', 'lib-dynload')
|
||||||
print 'Adding fontconfig'
|
print 'Adding fontconfig'
|
||||||
|
@ -9,7 +9,7 @@ Freeze app into executable using py2exe.
|
|||||||
QT_DIR = 'C:\\Qt\\4.4.3'
|
QT_DIR = 'C:\\Qt\\4.4.3'
|
||||||
LIBUSB_DIR = 'C:\\libusb'
|
LIBUSB_DIR = 'C:\\libusb'
|
||||||
LIBUNRAR = 'C:\\Program Files\\UnrarDLL\\unrar.dll'
|
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'
|
IMAGEMAGICK_DIR = 'C:\\ImageMagick'
|
||||||
FONTCONFIG_DIR = 'C:\\fontconfig'
|
FONTCONFIG_DIR = 'C:\\fontconfig'
|
||||||
VC90 = r'C:\VC90.CRT'
|
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)))
|
shutil.copyfile(LIBUNRAR, os.path.join(PY2EXE_DIR, os.path.basename(LIBUNRAR)))
|
||||||
print '\tAdding pdftohtml'
|
print '\tAdding pdftohtml'
|
||||||
shutil.copyfile(PDFTOHTML, os.path.join(PY2EXE_DIR, os.path.basename(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'
|
print '\tAdding ImageMagick'
|
||||||
for f in os.listdir(IMAGEMAGICK_DIR):
|
for f in os.listdir(IMAGEMAGICK_DIR):
|
||||||
shutil.copyfile(os.path.join(IMAGEMAGICK_DIR, f), os.path.join(PY2EXE_DIR, f))
|
shutil.copyfile(os.path.join(IMAGEMAGICK_DIR, f), os.path.join(PY2EXE_DIR, f))
|
||||||
|
@ -17,10 +17,10 @@ def option_parser():
|
|||||||
|
|
||||||
Run an embedded python interpreter.
|
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. '+
|
help='Update the specified module in the frozen library. '+
|
||||||
'Module specifications are of the form full.name.of.module,path_to_module.py',
|
'Module specifications are of the form full.name.of.module path_to_module.py',
|
||||||
default=None
|
|
||||||
)
|
)
|
||||||
parser.add_option('-c', '--command', help='Run python code.', default=None)
|
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.')
|
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
|
from calibre.gui2.main import main
|
||||||
main(['calibre'])
|
main(['calibre'])
|
||||||
elif opts.update_module:
|
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))
|
update_module(mod, os.path.expanduser(path))
|
||||||
elif opts.command:
|
elif opts.command:
|
||||||
sys.argv = args[:1]
|
sys.argv = args[:1]
|
||||||
|
@ -36,7 +36,8 @@ def generate_html(pathtopdf, tdir):
|
|||||||
index = os.path.join(tdir, 'index.html')
|
index = os.path.join(tdir, 'index.html')
|
||||||
# This is neccessary as pdftohtml doesn't always (linux) respect absolute paths
|
# This is neccessary as pdftohtml doesn't always (linux) respect absolute paths
|
||||||
pathtopdf = os.path.abspath(pathtopdf)
|
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()
|
cwd = os.getcwd()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -96,12 +96,12 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
|||||||
self.viewers = collections.deque()
|
self.viewers = collections.deque()
|
||||||
self.content_server = None
|
self.content_server = None
|
||||||
self.system_tray_icon = QSystemTrayIcon(QIcon(':/library'), self)
|
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']:
|
if not config['systray_icon']:
|
||||||
self.system_tray_icon.hide()
|
self.system_tray_icon.hide()
|
||||||
else:
|
else:
|
||||||
self.system_tray_icon.show()
|
self.system_tray_icon.show()
|
||||||
self.system_tray_menu = QMenu()
|
self.system_tray_menu = QMenu(self)
|
||||||
self.restore_action = self.system_tray_menu.addAction(
|
self.restore_action = self.system_tray_menu.addAction(
|
||||||
QIcon(':/images/page.svg'), _('&Restore'))
|
QIcon(':/images/page.svg'), _('&Restore'))
|
||||||
self.donate_action = self.system_tray_menu.addAction(
|
self.donate_action = self.system_tray_menu.addAction(
|
||||||
|
@ -93,7 +93,7 @@ def options(option_parser):
|
|||||||
def opts_and_words(name, op, words):
|
def opts_and_words(name, op, words):
|
||||||
opts = '|'.join(options(op))
|
opts = '|'.join(options(op))
|
||||||
words = '|'.join([w.replace("'", "\\'") for w in words])
|
words = '|'.join([w.replace("'", "\\'") for w in words])
|
||||||
return '_'+name+'()'+\
|
return ('_'+name+'()'+\
|
||||||
'''
|
'''
|
||||||
{
|
{
|
||||||
local cur opts
|
local cur opts
|
||||||
@ -117,7 +117,7 @@ def opts_and_words(name, op, words):
|
|||||||
esac
|
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):
|
def opts_and_exts(name, op, exts):
|
||||||
|
@ -19,6 +19,7 @@ DEPENDENCIES = [
|
|||||||
('python-dateutil', '1.4.1', 'python-dateutil', 'python-dateutil', 'python-dateutil'),
|
('python-dateutil', '1.4.1', 'python-dateutil', 'python-dateutil', 'python-dateutil'),
|
||||||
('BeautifulSoup', '3.0.5', 'beautifulsoup', 'python-beautifulsoup', 'python-BeautifulSoup'),
|
('BeautifulSoup', '3.0.5', 'beautifulsoup', 'python-beautifulsoup', 'python-BeautifulSoup'),
|
||||||
('dnspython', '1.6.0', 'dnspython', 'dnspython', 'dnspython', 'dnspython'),
|
('dnspython', '1.6.0', 'dnspython', 'dnspython', 'dnspython', 'dnspython'),
|
||||||
|
('poppler', '0.10.5', 'poppler', 'poppler', 'poppler', 'poppler'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user