X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/65916b0958b55a24073cb592e31b6bb7ac0585b9..926c8a3e09932478189cc103f4e02787ae66cc61:/librarian/pdf.py diff --git a/librarian/pdf.py b/librarian/pdf.py index bcf8d9a..ace83af 100644 --- a/librarian/pdf.py +++ b/librarian/pdf.py @@ -180,14 +180,15 @@ def transform(wldoc, verbose=False, save_tex=None, morefloats=None, verbose: prints all output from LaTeX save_tex: path to save the intermediary LaTeX file to morefloats (old/new/none): force specific morefloats - cover: a cover.Cover object - flags: less-advertising, + cover: a cover.Cover object or True for default + flags: less-advertising, not-wl, images customizations: user requested customizations regarding various formatting parameters (passed to wl LaTeX class) """ + # TODO: images # Parse XSLT try: - document = load_including_children(wldoc) + document = load_including_children(wldoc) if cover: if cover is True: @@ -234,6 +235,9 @@ def transform(wldoc, verbose=False, save_tex=None, morefloats=None, with open(os.path.join(temp, 'cover.png'), 'w') as f: c.save(f) + for img in document.edoc.findall('//ilustr'): + shutil.copy(img.get('src'), temp) + del document # no longer needed large object :) tex_path = os.path.join(temp, 'doc.tex') @@ -249,6 +253,10 @@ def transform(wldoc, verbose=False, save_tex=None, morefloats=None, shutil.copy(get_resource('pdf/wl.cls'), temp) shutil.copy(get_resource('res/wl-logo.png'), temp) + # FIXME: temporary + shutil.copy(get_resource('res/ofop-logo.png'), temp) + shutil.copy(get_resource('res/logo-fio.jpg'), temp) + cwd = os.getcwd() os.chdir(temp)