reportlab/pdfgen/canvas.py
changeset 494 54257447cfe9
parent 489 a68bf60b47cd
child 500 58d712fef651
equal deleted inserted replaced
493:89dbc0b19ede 494:54257447cfe9
     1 ###############################################################################
     1 #copyright ReportLab Inc. 2000
     2 #
     2 #see license.txt for license details
     3 #	ReportLab Public License Version 1.0
     3 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/pdfgen/canvas.py?cvsroot=reportlab
     4 #
     4 #$Header: /tmp/reportlab/reportlab/pdfgen/canvas.py,v 1.55 2000/10/25 08:57:45 rgbecker Exp $
     5 #   Except for the change of names the spirit and intention of this
     5 __version__=''' $Id: canvas.py,v 1.55 2000/10/25 08:57:45 rgbecker Exp $ '''
     6 #   license is the same as that of Python
       
     7 #
       
     8 #	(C) Copyright ReportLab Inc. 1998-2000.
       
     9 #
       
    10 #
       
    11 # All Rights Reserved
       
    12 #
       
    13 # Permission to use, copy, modify, and distribute this software and its
       
    14 # documentation for any purpose and without fee is hereby granted, provided
       
    15 # that the above copyright notice appear in all copies and that both that
       
    16 # copyright notice and this permission notice appear in supporting
       
    17 # documentation, and that the name of ReportLab not be used
       
    18 # in advertising or publicity pertaining to distribution of the software
       
    19 # without specific, written prior permission. 
       
    20 # 
       
    21 #
       
    22 # Disclaimer
       
    23 #
       
    24 # ReportLab Inc. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
       
    25 # SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
       
    26 # IN NO EVENT SHALL ReportLab BE LIABLE FOR ANY SPECIAL, INDIRECT
       
    27 # OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
       
    28 # OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
       
    29 # OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
       
    30 # PERFORMANCE OF THIS SOFTWARE. 
       
    31 #
       
    32 ###############################################################################
       
    33 #	$Log: canvas.py,v $
       
    34 #	Revision 1.54  2000/10/24 02:04:14  aaron_watters
       
    35 #	sliced out image functionality (oops adding in pdfimages.py next) tests pass
       
    36 #
       
    37 #	Revision 1.53  2000/10/18 05:03:21  aaron_watters
       
    38 #	complete revision of pdfdoc.  Not finished (compression missing, testing needed)
       
    39 #	I got Robin's last change in at the last moment :)
       
    40 #	
       
    41 #	Revision 1.52  2000/10/15 21:57:13  andy_robinson
       
    42 #	Added showFullScreen0
       
    43 #	
       
    44 #	Revision 1.51  2000/09/04 08:06:15  rgbecker
       
    45 #	Fix spurious comment reference to layout
       
    46 #	
       
    47 #	Revision 1.50  2000/09/01 12:13:26  rgbecker
       
    48 #	Improved optimisation checks
       
    49 #	
       
    50 #	Revision 1.49  2000/08/31 23:34:36  rgbecker
       
    51 #	Fix transform optimisation
       
    52 #	
       
    53 #	Revision 1.48  2000/08/20 21:39:50  andy_robinson
       
    54 #	Changed an argument syntax for clarity
       
    55 #	
       
    56 #	Revision 1.47  2000/08/17 15:50:36  rgbecker
       
    57 #	Various brutal changes to paragraph, canvas and textobject for speed/size
       
    58 #	
       
    59 #	Revision 1.46  2000/08/01 11:28:33  rgbecker
       
    60 #	Converted to using fp_str
       
    61 #	
       
    62 #	Revision 1.45  2000/07/31 12:03:23  rgbecker
       
    63 #	B Herzog fix to dimension formats
       
    64 #	
       
    65 #	Revision 1.44  2000/07/28 00:00:41  rgbecker
       
    66 #	Bernhard herzog inspired fixes
       
    67 #	
       
    68 #	Revision 1.43  2000/06/30 15:27:55  rgbecker
       
    69 #	Allow for non-caching of images
       
    70 #	
       
    71 #	Revision 1.42  2000/06/26 15:58:22  rgbecker
       
    72 #	Simple fix to widths problem
       
    73 #	
       
    74 #	Revision 1.41  2000/06/09 16:18:19  andy_robinson
       
    75 #	Doc strings, sequencer
       
    76 #	
       
    77 #	Revision 1.40  2000/06/09 01:45:22  aaron_watters
       
    78 #	Lots of documentation additions and changes.
       
    79 #	
       
    80 #	Revision 1.39  2000/06/01 15:23:06  rgbecker
       
    81 #	Platypus re-organisation
       
    82 #	
       
    83 #	Revision 1.38  2000/05/26 09:44:40  rgbecker
       
    84 #	generalised colors slightly
       
    85 #	
       
    86 #	Revision 1.37  2000/05/23 14:06:45  andy_robinson
       
    87 #	Preformatted objects now know how to split themselves.
       
    88 #	
       
    89 #	Revision 1.36  2000/05/18 17:11:12  aaron_watters
       
    90 #	removed 0's on stable linkage and outline operations.
       
    91 #	
       
    92 #	Revision 1.35  2000/05/18 09:05:08  andy_robinson
       
    93 #	Resynchronization
       
    94 #	
       
    95 #	Revision 1.34  2000/04/28 17:33:44  andy_robinson
       
    96 #	Added font encoding support and changed default encoding to WinAnsi
       
    97 #	
       
    98 #	Revision 1.33  2000/04/28 14:18:16  rgbecker
       
    99 #	Use str(filename) not '<Unknown>'
       
   100 #	
       
   101 #	Revision 1.32  2000/04/28 13:37:40  rgbecker
       
   102 #	Fix verbose filename print when it's actually a file type object
       
   103 #	
       
   104 #	Revision 1.31  2000/04/28 09:10:20  rgbecker
       
   105 #	Changed zlib error handling
       
   106 #	
       
   107 #	Revision 1.30  2000/04/25 20:20:13  aaron_watters
       
   108 #	Added support for closed outline entries
       
   109 #	
       
   110 #	Revision 1.29  2000/04/18 19:52:35  aaron_watters
       
   111 #	eliminated inForm/inPage apis in favor of only beginForm..endForm
       
   112 #	(page mode is automatically inferred when page-only operations are
       
   113 #	attempted...)
       
   114 #	
       
   115 #	Revision 1.28  2000/04/15 14:58:32  aaron_watters
       
   116 #	Completed addOutlineEntry0 api
       
   117 #	
       
   118 #	Revision 1.27  2000/04/14 11:28:32  andy_robinson
       
   119 #	Removed illegal append statement usage in canvas.grid()
       
   120 #	
       
   121 #	Revision 1.26  2000/04/12 16:26:51  rgbecker
       
   122 #	XML Tagged Paragraph parser changes
       
   123 #	
       
   124 #	Revision 1.25  2000/04/10 09:21:21  andy_robinson
       
   125 #	Color methods in textobject and canvas now synchronised.
       
   126 #	Added 'verbosity' keyword to allow hiding of 'save myfile.pdf' messages.
       
   127 #	
       
   128 #	Revision 1.24  2000/04/06 09:52:02  andy_robinson
       
   129 #	Removed some old comments; tweaks to experimental Outline methods.
       
   130 #	
       
   131 #	Revision 1.23  2000/04/05 16:26:36  rgbecker
       
   132 #	Fixes to setFill/StrokeColor
       
   133 #	
       
   134 #	Revision 1.22  2000/04/05 16:21:02  rgbecker
       
   135 #	Added _SeqTypes for efficiency
       
   136 #	
       
   137 #	Revision 1.21  2000/04/05 16:15:11  rgbecker
       
   138 #	Made setFill/StrokeColor polymorphic
       
   139 #	
       
   140 #	Revision 1.20  2000/04/03 09:36:15  andy_robinson
       
   141 #	Using trailing zero convention for new form and link API
       
   142 #	
       
   143 #	Revision 1.19  2000/04/02 02:53:49  aaron_watters
       
   144 #	added support for outline trees
       
   145 #	
       
   146 #	Revision 1.18  2000/03/26 20:45:01  aaron_watters
       
   147 #	added beginForm..endForm and fixed some naming convention issues.
       
   148 #	
       
   149 #	Revision 1.17  2000/03/24 21:02:21  aaron_watters
       
   150 #	added support for destinations, forms, linkages
       
   151 #	
       
   152 #	Revision 1.15  2000/03/10 21:46:04  andy_robinson
       
   153 #	fixed typo in setDash
       
   154 #	
       
   155 #	Revision 1.14  2000/03/08 13:40:03  andy_robinson
       
   156 #	Canvas has two methods setFillColor(aColor) and setStrokeColor(aColor)
       
   157 #	which accepts color objects directly.
       
   158 #	
       
   159 #	Revision 1.13  2000/03/06 20:06:36  rgbecker
       
   160 #	Typo self._currentPageHasImages = 1
       
   161 #	
       
   162 #	Revision 1.12  2000/03/02 12:58:58  rgbecker
       
   163 #	Remove over officious import checks Imag/zlib
       
   164 #	
       
   165 #	Revision 1.11  2000/03/02 10:28:54  rgbecker
       
   166 #	[].extend illegal in 1.5.1
       
   167 #	
       
   168 #	Revision 1.10  2000/02/24 17:28:13  andy_robinson
       
   169 #	Added methods setFillGray(g), setStrokeGray(g) where 0 <= g <= 1
       
   170 #	
       
   171 #	Revision 1.9  2000/02/24 09:12:55  andy_robinson
       
   172 #	
       
   173 #	Removed some constants which are no longer used.
       
   174 #	
       
   175 #	Revision 1.8  2000/02/20 14:43:27  rgbecker
       
   176 #	_currentPageHasImages = 0 in init
       
   177 #	
       
   178 #	Revision 1.7  2000/02/20 11:08:56  rgbecker
       
   179 #	Canvas.setPageSize fix
       
   180 #	
       
   181 #	Revision 1.6  2000/02/17 15:26:28  rgbecker
       
   182 #	Change page compression default
       
   183 #	
       
   184 #	Revision 1.5  2000/02/17 02:08:04  rgbecker
       
   185 #	Docstring & other fixes
       
   186 #	
       
   187 #	Revision 1.4  2000/02/16 09:42:50  rgbecker
       
   188 #	Conversion to reportlab package
       
   189 #	
       
   190 #	Revision 1.3  2000/02/15 17:55:59  rgbecker
       
   191 #	License text fixes
       
   192 #	
       
   193 #	Revision 1.2  2000/02/15 15:47:09  rgbecker
       
   194 #	Added license, __version__ and Logi comment
       
   195 #	
       
   196 __version__=''' $Id: canvas.py,v 1.54 2000/10/24 02:04:14 aaron_watters Exp $ '''
       
   197 __doc__=""" 
     6 __doc__=""" 
   198 PDFgen is a library to generate PDF files containing text and graphics.  It is the 
     7 PDFgen is a library to generate PDF files containing text and graphics.  It is the 
   199 foundation for a complete reporting solution in Python.  It is also the
     8 foundation for a complete reporting solution in Python.  It is also the
   200 foundation for piddlePDF, the PDF back end for PIDDLE.
     9 foundation for piddlePDF, the PDF back end for PIDDLE.
   201 
    10