Commit b5163597 authored by Tristan Cavelier's avatar Tristan Cavelier

interfaces/convertable: add api to put linked document into data

parent bb77c51a
...@@ -115,3 +115,40 @@ class IConvertable(IFormatConvertable): ...@@ -115,3 +115,40 @@ class IConvertable(IFormatConvertable):
kw -- optional parameters which can be passed to the kw -- optional parameters which can be passed to the
conversion engine conversion engine
""" """
def buildEmbbededLinkedDocumentDataXXX(self, alternative_data=None, insert_image=True, insert_stylesheet=True, insert_other=False):
"""
Fetches linked documents (stylesheets, images, ...) and replace their link
to actual fetched content. Returns a new build of the current document data
with the inserted components.
It is very useful for document conversion like HTML to PDF or SVG to any
image format.
Use it carefully! This can lead to share images that you don't want people
to see!
alternative_data is the data to use instead of self.getData().
XXX use portal_transforms ?
"""
def extractAndBuildComponentAsLinkDataListXXX(self, alternative_data=None, extract_image=True, extract_stylesheets=True, extract_other=False):
"""
Creates a list of document edit_kw containing the exploded data to several
documents, so that it is easy to convert into a mail format (mhtml) or to
export extracted documents to modules.
The result list contains at least one entry : the altered data
Result sample:
[
{"data": "..."},
{"title": "Image Title", "content_type": "image/png", "data": "\x01\x02..."},
{"content_type": "text/css", "data": "body { background-color: fuchsia; }"},
]
alternative_data is the data to use instead of self.getData().
"""
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment