Commit f9c230b7 authored by Bartek Górny's avatar Bartek Górny

return original format if no format specified

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12924 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5539d47f
...@@ -68,12 +68,15 @@ class PDFDocument(File, ConversionCacheMixin): ...@@ -68,12 +68,15 @@ class PDFDocument(File, ConversionCacheMixin):
) )
def index_html(self, REQUEST, RESPONSE, format, force=0): def index_html(self, REQUEST, RESPONSE, format=None, force=0):
""" """
Returns data in the appropriate format (graphical) Returns data in the appropriate format (graphical)
it is always a zip because multi-page pdfs are converted into a zip it is always a zip because multi-page pdfs are converted into a zip
file of many images file of many images
""" """
if format is None:
RESPONSE.setHeader('Content-Type', 'application/pdf')
return self._unpackData(self.data)
if format == 'html': if format == 'html':
RESPONSE.setHeader('Content-Type', 'text/html;charset=UTF-8') RESPONSE.setHeader('Content-Type', 'text/html;charset=UTF-8')
return self.getHtmlRepresentation(force) return self.getHtmlRepresentation(force)
......
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