[reportlab-users] Increarsing top margin of text i paragraph

Robin Becker robin at reportlab.com
Tue Mar 1 09:57:20 EST 2011


On 01/03/2011 14:26, gonandriy wrote:

> Imagine for example, we have not logo image above title

> _______________________________________________

all the code for this is available in the SVN repository.

Effectively we use the package tools.docco available here

https://svn.reportlab.com/svn/public/reportlab/trunk/tools/docco/

the userguide is generated using the code here

https://svn.reportlab.com/svn/public/reportlab/trunk/docs/userguide/

This code has lots of shortcuts and is using the platypus Doctemplate mechanisms
to do coverpage positioning etc etc.


You can start like this


###############################################################
import sys,os
from reportlab.lib.utils import open_and_read
from reportlab.pdfbase.pdfmetrics import registerFontFamily
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
pdfmetrics.registerFont(TTFont('Vera', 'Vera.ttf'))
pdfmetrics.registerFont(TTFont('VeraBd', 'VeraBd.ttf'))
pdfmetrics.registerFont(TTFont('VeraIt', 'VeraIt.ttf'))
pdfmetrics.registerFont(TTFont('VeraBI', 'VeraBI.ttf'))
registerFontFamily('Vera',normal='Vera',bold='VeraBd',italic='VeraIt',boldItalic='VeraBI')
from tools.docco.rl_doc_utils import setStory, getStory, RLDocTemplate,
defaultPageSize, H1, H2, H3, H4
from tools.docco.rl_doc_utils import *
from datetime import datetime
doc = RLDocTemplate('example.pdf', pagesize = defaultPageSize)
setStory()
title("xxx PDF Library")
title("Test User Guide")
centred('My Version ' + '0.0')
centred(datetime.now().strftime('Document generated on %Y/%m/%d %H:%M:%S %Z'))
nextTemplate("Normal")
newPage()
disc("This should be on a new page")

story=getStory()
doc.multiBuild(story)
###############################################################



--
Robin Becker


More information about the reportlab-users mailing list