Changes

Jump to: navigation, search

Report API

147 bytes added, 18:33, 24 September 2007
m
no edit summary
[[Image:Doc_paper.png|thumbnail]] Description of the paper, which every report will be rendered on, is stored by an instance of the [http://www.gramps-project.org/api3/BaseDoc.PaperStyle-class.html PaperStyle class]. This instance is available via the <tt>BaseDoc.paper_style</tt> class attribute. The chosen PaperStyle is given to the document generator at initialization, and is handled by the reporting framework.
Text reports do not need to care about paper properties, as the document generator (or the external viewer) paginates the report according to those properties. While, on the other hand, graphical reports do need to take paper properties into account when creating graphical elements.[[Image:gramps-devel.png|left|22px]] ''document generator should hide paper properies for graphical reports too''<br/><br/>The <tt>PaperStyle</tt> holds information on the size of the paper ([http://www.gramps-project.org/api3/BaseDoc.PaperSize-class.html PaperSize class] instance), the size of the margins, and the orientation of the paper. Use the proper accessor methods to get the values. To get the metrics of the usable area of a page (page without the margins) one can also use the [http://www.gramps-project.org/api3/BaseDoc.PaperStyle-class.html#get_usable_width PaperStyle.get_usable_width] and [http://www.gramps-project.org/api3/BaseDoc.PaperStyle-class.html#get_usable_height PaperStyle.get_usable_height] convenience methods. Text reports do not need to care about paper properties, as the document generator (or the external viewer) paginates the report according to those properties. While, on the other hand, graphical reports do need to take paper properties into account when creating graphical elements, i.e. they should not draw on the margins.<!--[[Image:gramps-devel.png|left|22px]] ''document generator should hide paper properies for graphical reports too''--> The origin of the coordinate system is the top left corner of the usable area.
<br clear="all" />
35
edits

Navigation menu