[Erp5-report] r35622 nicolas - /erp5/trunk/products/ERP5/Document/PDFDocument.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue May 25 17:52:11 CEST 2010


Author: nicolas
Date: Tue May 25 17:52:07 2010
New Revision: 35622

URL: http://svn.erp5.org?rev=35622&view=rev
Log:
revert r29404 because it is not in good place (Should be in Image or at portal_transforms level) and change DPI even if
size of image is low.


Modified:
    erp5/trunk/products/ERP5/Document/PDFDocument.py

Modified: erp5/trunk/products/ERP5/Document/PDFDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/PDFDocument.py?rev=35622&r1=35621&r2=35622&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/PDFDocument.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/PDFDocument.py [utf8] Tue May 25 17:52:07 2010
@@ -126,24 +126,9 @@
       text = ''
       content_information = self.getContentInformation()
       page_count = int(content_information.get('Pages', 0))
-      try:
-        # if the dimension is too big, rasterized image can be too
-        # big. so we limit the maximum of rasterized image to 4096
-        # pixles.
-        # XXX since the dimention can be different on each page, it is
-        # better to call 'pdfinfo -f page_num -l page_num' to get the
-        # size of each page.
-        max_size = 4096
-        size = content_information.get('Page size',
-                                       '%s x %s pts' % (max_size, max_size))
-        width = int(size.split(' ')[0])
-        height = int(size.split(' ')[2])
-        resolution = 72.0 * max_size / max(width, height)
-      except (ValueError, ZeroDivisionError):
-        resolution = None
       for page_number in range(page_count):
         src_mimetype, png_data = self.convert(
-            'png', quality=100, resolution=resolution,
+            'png', quality=100, resolution=300,
             frame=page_number, display='identical')
         if not src_mimetype.endswith('png'):
           continue




More information about the Erp5-report mailing list