reportlab/lib/pagesizes.py
author andy_robinson
Wed, 08 Mar 2000 12:55:07 +0000
changeset 40 19b843a1f8f6
child 44 2467c3df925e
permissions -rw-r--r--
initial checkin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
     1
#!/bin/env python
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
     2
###############################################################################
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
     3
#
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
     4
#	ReportLab Public License Version 1.0
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
     5
#
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
     6
#   Except for the change of names the spirit and intention of this
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
     7
#   license is the same as that of Python
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
     8
#
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
     9
#	(C) Copyright ReportLab Inc. 1998-2000.
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    10
#
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    11
#   adapted with permission from PIDDLE, original author Joe Strout
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    12
#
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    13
# All Rights Reserved
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    14
#
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    15
# Permission to use, copy, modify, and distribute this software and its
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    16
# documentation for any purpose and without fee is hereby granted, provided
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    17
# that the above copyright notice appear in all copies and that both that
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    18
# copyright notice and this permission notice appear in supporting
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    19
# documentation, and that the name of ReportLab not be used
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    20
# in advertising or publicity pertaining to distribution of the software
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    21
# without specific, written prior permission. 
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    22
# 
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    23
#
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    24
# Disclaimer
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    25
#
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    26
# ReportLab Inc. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    27
# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    28
# IN NO EVENT SHALL ReportLab BE LIABLE FOR ANY SPECIAL, INDIRECT
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    29
# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    30
# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    31
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    32
# PERFORMANCE OF THIS SOFTWARE. 
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    33
#
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    34
###############################################################################
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    35
#	$Log: pagesizes.py,v $
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    36
#	Revision 1.1  2000/03/08 12:55:07  andy_robinson
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    37
#	initial checkin
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    38
#
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    39
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    40
"""This module defines a few common page sizes in points (1/72 inch).
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    41
To be expanded to include things like label sizes, envelope windows
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    42
etc."""
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    43
__version__=''' $Id: pagesizes.py,v 1.1 2000/03/08 12:55:07 andy_robinson Exp $ '''
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    44
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    45
from units import cm, inch
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    46
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    47
_W, _H = (21*cm, 29.7*cm)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    48
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    49
A6 = (_W*.5, _H*.5)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    50
A5 = (_H*.5, _W)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    51
A4 = (_W, _H)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    52
A3 = (_H*2, _W)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    53
A2 = (_W*2, _H*2)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    54
A1 = (_H*4, _W*2)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    55
A0 = (_W*4, _H*4)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    56
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    57
letter = (8.5*inch, 11*inch)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    58
legal = (8.5*inch, 17*inch)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    59
elevenSeventeen = (11*inch, 17*inch)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    60
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    61
_BW, _BH = (25*cm, 35.3*cm)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    62
B6 = (_BW*.5, _BH*.5)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    63
B5 = (_BH*.5, _BW)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    64
B4 = (_BW, _BH)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    65
B3 = (_BH*2, _BW)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    66
B2 = (_BW*2, _BH*2)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    67
B1 = (_BH*4, _BW*2)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    68
B0 = (_BW*4, _BH*4)
19b843a1f8f6 initial checkin
andy_robinson
parents:
diff changeset
    69