Nice tool, thanks for your efforts! I had some rather
big images that I wanted to scale down to the page
width, so I created a 'fit_width' keyword to the
Image() class that modifies the scale parameters so
that the image fits the width specified.
Usage example is below. I had to specify the width in the
Image() constructor because there's no other way of knowing
what the width of the viewable page is, since the Image is
not created as a child of the Section.
Patch for Elements.py
Logged In: YES
user_id=13885
Usage example is below. I had to specify the width in the
Image() constructor because there's no other way of knowing
what the width of the viewable page is, since the Image is
not created as a child of the Section.
doc = Document()
section = Section(paper=StandardPaper.LETTER)
doc.Sections.append( section )
section.append( 'PNG Graphic' )
image = Image( 'test-2.png', fit_width=section.Width )
section.append( Paragraph( image ) )