katerina7479/pypdflite — pull request #10 by tjoneslo (2014-03-19 02:26:22+00:00)
Title: Transforms

Add two different types of transformations to the library.

The first extends PDFText to allow transforming text. The operations include scaling, rotation, skewing, and positioning. The positioning can be done using the cursor, but with this option the positioning can be combined with other options.

I added this option mostly to allow some text rotation on the PDFs I'm creating, but extended it to the general case.

The difficult part here is the internal cursor tracking doesn't take into account of the transformations. So, for example, scaling the text down or up in the horizontal direction, the page cursor won't correctly know the location of where to place the next text. So use with caution.

Second is to add a PDFTransforms class, which allows performing the same options (scale, rotation, skewing, positioning) on graphics (e.g. lines and ellipses). This is untested, and like the text transformation, may leave the page state different from the library state.