Commits

Dinu Gherman  committed 59dc640

Standardized line-ends and spacing.

  • Participants
  • Parent commits 4ec1cf7

Comments (0)

Files changed (2)

 import getopt
 import os.path
 
+## FIXME: make import explicit
 from pdfnup import *
 
 
       # (useful to bring a bunch of smaller formats to one A4 sized page)
   %(prog)s -n 8 -f a4 -m file.pdf # 8 pages per sheet on an A4 output format
       # but with 8 copies of page 1 on the first output page, etc.
-  
-  
 
 COPYLEFT:
   see http://www.gnu.org/copyleft/gpl.html
 """
 _mtA4Pdf = zlib.decompress(base64.decodestring(_mtA4PdfZip64))
 
-# Some basic paper dimensions calculated using reportlab. Given in points (user space units = 1/72 inch)
-dimensions = {'a0': (2381.102362204724, 3367.55905511811),
-              'a1': (1683.779527559055, 2381.102362204724),
-              'a2': (1190.551181102362, 1683.779527559055),
-              'a3': (841.8897637795275, 1190.551181102362),
-              'a4': (595.275590551181, 841.8897637795275),
-              'a5': (420.94488188976374, 595.275590551181),
-              'a6': (297.6377952755905, 420.94488188976374),
-              'a7': (210.47244094488187, 297.6377952755905),
-              'a8': (148.81889763779526, 210.47244094488187),
-              'a9': (105.23622047244093, 148.81889763779526),
-              'a10': (74.40944881889763, 105.23622047244093),
-              'elevenseventeen': (792.0, 1224.0),
-              'legal': (612.0, 1008.0),
-              'letter': (612.0, 792.0)}
+
+# Some basic paper dimensions calculated using reportlab.
+# Given in points (user space units = 1/72 inch)
+dimensions = {'a0': (2381.102362204724, 3367.55905511811),
+              'a1': (1683.779527559055, 2381.102362204724),
+              'a2': (1190.551181102362, 1683.779527559055),
+              'a3': (841.8897637795275, 1190.551181102362),
+              'a4': (595.275590551181, 841.8897637795275),
+              'a5': (420.94488188976374, 595.275590551181),
+              'a6': (297.6377952755905, 420.94488188976374),
+              'a7': (210.47244094488187, 297.6377952755905),
+              'a8': (148.81889763779526, 210.47244094488187),
+              'a9': (105.23622047244093, 148.81889763779526),
+              'a10': (74.40944881889763, 105.23622047244093),
+              'elevenseventeen': (792.0, 1224.0),
+              'legal': (612.0, 1008.0),
+              'letter': (612.0, 792.0)}
+
 
 def getDimensions(outputFormat):
-    "Get the dimensions of the given paper format in points (user space units = 1/72 inch)"
+    "Get the dimensions of the given paper format in points."
+    
     if not outputFormat.lower() in dimensions:
         raise LookupError("Unknown format: '%s'" % outputFormat)
     return dimensions[outputFormat.lower()]
 
+
 def isSquare(n):
     "Is this a square number?"
 
         return xscale, yscale
 
 
-
 def calcRects(pageSize, numTiles, dirs="RD"):
     "Return list of sub rects for some rect."