- if cover:
- if cover is True:
- cover = WLCover
- bound_cover = cover(book_info)
- root.set('data-cover-width', str(bound_cover.width))
- root.set('data-cover-height', str(bound_cover.height))
- if bound_cover.uses_dc_cover:
- if book_info.cover_by:
- root.set('data-cover-by', book_info.cover_by)
- if book_info.cover_source:
- root.set('data-cover-source',
- book_info.cover_source)
- if flags:
- for flag in flags:
- root.set('flag-' + flag, 'yes')
-
- # check for LaTeX packages
- if morefloats:
- root.set('morefloats', morefloats.lower())
- elif package_available('morefloats', 'maxfloats=19'):
- root.set('morefloats', 'new')
-
- # add customizations
- if customizations is not None:
- root.set('customizations', u','.join(customizations))
-
- # add editors info
+ document = WLDocument.from_string(text,
+ parse_dublincore=True, provider=provider)
+ document.swap_endlines()
+
+ for child_uri in document.book_info.parts:
+ child = load_including_children(provider=provider, uri=child_uri)
+ document.edoc.getroot().append(child.edoc.getroot())
+ return document
+
+
+class PDFFormat(Format):
+ """ Base PDF format.
+
+ Available customization:
+ nofootnotes: Doesn't do footnotes.
+ nothemes: Doesn't do themes.
+ defaultleading: Default leading.
+ onehalfleading: Bigger leading.
+ doubleleading: Big leading.
+ nowlfont: Uses standard TeX font instead of JUnicodeWL.
+
+ """
+
+ cover_class = None
+ tex_passes = 1
+ style = get_resource('pdf/default.sty')
+ cover = None
+
+ @property
+ def has_cover(self):
+ """ For use in XSLT. """
+ return self.cover is not None
+
+ @property
+ def customization_str(self):
+ """ For use in XSLT. """
+ return u','.join(k for k, v in self.customization.items() if v)
+
+ def get_document(self):
+ document = load_including_children(self.wldoc)
+ root = document.edoc.getroot()