diff --git a/cloudooo/handler/wkhtmltopdf/tests/testWkhtmltopdfServer.py b/cloudooo/handler/wkhtmltopdf/tests/testWkhtmltopdfServer.py
index bd69d6c4ae4a0f5bba1e919d0bd83d1106b481ca..5c1be4c830e227b28ea84c3eca19d2e1a18fdbff 100644
--- a/cloudooo/handler/wkhtmltopdf/tests/testWkhtmltopdfServer.py
+++ b/cloudooo/handler/wkhtmltopdf/tests/testWkhtmltopdfServer.py
@@ -35,6 +35,7 @@ class TestServer(TestCase):
return [
(join('data', 'test_with_png_dataurl.html'), "html", "pdf", "application/pdf"),
(join('data', 'test_with_script.html'), "html", "pdf", "application/pdf"),
+ (join('data', 'test_with_script.html'), "htm", "pdf", "application/pdf"),
]
def testConvertHtmltoPdf(self):
diff --git a/cloudooo/interfaces/manager.py b/cloudooo/interfaces/manager.py
index ba30c9a11c2e9be93da51784a86ed80884657c07..a8a5ce593de4229a54274992b5e84471a040dc74 100644
--- a/cloudooo/interfaces/manager.py
+++ b/cloudooo/interfaces/manager.py
@@ -33,12 +33,12 @@ class IManager(Interface):
"""Provides public method to communicate with Cloudooo clients
"""
- def convertFile(content, source_mimetype, destination_mimetype, **kw):
+ def convertFile(content, source_format, destination_format, **kw):
"""Returns the converted file in the given format.
content : binary data to convert
- source_mimetype : mimetype of given content
- destination_mimetype : expected output conversion mimetype
+ source_format : input format (extension without '.')
+ destination_format : output conversion format (extension without '.')
**kw holds specific parameters for the conversion
"""
@@ -59,17 +59,17 @@ class IManager(Interface):
**kw holds specific parameters for the conversion
"""
- def getFileMetadataItemList(content, source_mimetype):
+ def getFileMetadataItemList(content, source_format):
"""Returns a list key, value pairs representing the
metadata values for the document. The structure of this
list is "unpredictable" and follows the convention of each file.
content : binary data where to reads metadata
- source_mimetype : mimetype of given content
+ source_format : input format (extension without '.')
"""
- def convertFileAndGetMetadataItemList(content, source_mimetype,
- destination_mimetype, **kw):
+ def convertFileAndGetMetadataItemList(content, source_format,
+ destination_format, **kw):
"""returns a converted version of provided content plus a
dictionary of extracted metadata.
signature of method is same as convertFile
@@ -78,12 +78,12 @@ class IManager(Interface):
'metadata' entries.
"""
- def updateFileMetadata(content, source_mimetype, metadata_dict):
+ def updateFileMetadata(content, source_format, metadata_dict):
"""Updates the content with provided metadata and
return the new file.
content : binary data to convert
- source_mimetype : mimetype of given content
+ source_format : input format (extension without '.')
metadata_dict : Metadatas to include in content
"""
diff --git a/cloudooo/manager.py b/cloudooo/manager.py
index 8ca504543cecf23b6197e0b8674f5fec45ec7cda..95f56686b4f9b087a0203877096ec40159d1c832 100644
--- a/cloudooo/manager.py
+++ b/cloudooo/manager.py
@@ -123,8 +123,8 @@ class Manager(object):
# use the conversion_kw in a possible interoperable way between all
# "html to pdf" handlers.
if (conversion_kw and
- source_format in ("html", "text/html") and
- destination_format in ("pdf", "application/pdf")):
+ source_format in ("htm", "html") and
+ destination_format == "pdf"):
handler_class = WkhtmltopdfHandler
else:
handler_class = getHandlerClass(source_format,