Module Expr Str Import alias Import alias ImportFrom alias alias alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index Num ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign NameStore ListLoad Call NameLoad BinOpMult Num NameLoad BinOpMult Num NameLoad BinOpSub NameLoad BinOpMult Num NameLoad BinOpSub NameLoad BinOpMult Num NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad Call NameLoad NameLoad attr Index Num Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr BinOpDiv NameLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Assign AttributeStore NameLoad attr BinOpDiv NameLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore BinOpMod Str Call AttributeLoad AttributeLoad NameLoad attr attr Str If CompareEq NameLoad Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Str ListLoad Num NameLoad AttributeLoad NameLoad attr NameLoad decorator_list decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Num Assign NameStore Call NameLoad keyword Str keyword Num keyword Num Assign NameStore Call NameLoad keyword Str keyword Num keyword Num Assign AttributeStore NameLoad attr ListLoad NameLoad NameLoad Return ListLoad NameLoad Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad Call NameLoad NameLoad keyword Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Assign NameStore ListLoad Call NameLoad Str Expr Call AttributeLoad NameLoad attr Call NameLoad For NameStore Call NameLoad Num body Expr Call AttributeLoad NameLoad attr Call NameLoad BinOpAdd Str Call NameLoad NameLoad SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Assign TupleStore NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num Assign NameStore BinOpAdd Str Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call NameLoad NameLoad NameLoad
N/A N/A 
usage: platypus_pdf_template.py source.pdf

Creates platypus.source.pdf

Example of using pdfrw to use page 1 of a source PDF as the background
for other pages programmatically generated with Platypus.

Contributed by user asannes

 N/A sys N/A os reportlab.platypus PageTemplate BaseDocTemplate Frame reportlab.platypus NextPageTemplate Paragraph PageBreak reportlab.platypus.tableofcontents TableOfContents reportlab.lib.styles getSampleStyleSheet ParagraphStyle reportlab.rl_config defaultPageSize reportlab.lib.units inch reportlab.graphics renderPDF pdfrw PdfReader pdfrw.buildxobj pagexobj pdfrw.toreportlab makerl N/A PAGE_WIDTH N/A defaultPageSize N/A 0 N/A PAGE_HEIGHT N/A defaultPageSize N/A 1 MyTemplate N/A PageTemplate N/A N/A The kernel of this example, where we use pdfrw to fill in the
    background of a page before writing to it.  This could be used to fill
    in a water mark or similar. __init__ N/A N/A self pdf_template_filename name N/A None N/A N/A frames N/A N/A Frame N/A 0.85 inch N/A 0.5 inch N/A PAGE_WIDTH N/A 1.15 inch N/A PAGE_HEIGHT N/A 1.5 inch N/A N/A N/A PageTemplate __init__ self name frames N/A page N/A N/A N/A PdfReader pdf_template_filename pages N/A 0 N/A N/A self page_template N/A pagexobj page N/A N/A self page_xscale N/A PAGE_WIDTH N/A N/A N/A self page_template BBox N/A 2 N/A N/A self page_yscale N/A PAGE_HEIGHT N/A N/A N/A self page_template BBox N/A 3 N/A beforeDrawPage N/A N/A self canvas doc N/A N/A N/A Draws the background before anything else N/A N/A N/A canvas saveState N/A rl_obj N/A makerl canvas N/A self page_template N/A N/A N/A canvas scale N/A self page_xscale N/A self page_yscale N/A N/A N/A canvas doForm rl_obj N/A N/A N/A canvas restoreState N/A N/A MyDocTemplate N/A BaseDocTemplate N/A N/A Used to apply heading to table of contents. afterFlowable N/A N/A self flowable N/A N/A N/A Adds Heading1 to table of contents N/A N/A N/A N/A flowable __class__ __name__ Paragraph N/A N/A style N/A N/A flowable style name N/A text N/A N/A flowable getPlainText N/A key N/A %s N/A N/A N/A self seq nextf toc N/A N/A style Heading1 N/A N/A N/A N/A N/A self canv bookmarkPage key N/A N/A N/A self notify TOCEntry N/A 1 text N/A self page key N/A N/A create_toc N/A N/A N/A N/A N/A Creates the table of contents N/A table_of_contents N/A TableOfContents N/A N/A table_of_contents dotsMinLevel 0 N/A header1 N/A ParagraphStyle name Heading1 fontSize 16 leading 16 N/A header2 N/A ParagraphStyle name Heading2 fontSize 14 leading 14 N/A N/A table_of_contents levelStyles N/A header1 header2 N/A N/A table_of_contents N/A PageBreak N/A create_pdf N/A N/A filename pdf_template_filename N/A N/A N/A Create the pdf, with all the contents N/A pdf_report N/A open filename wb N/A document N/A MyDocTemplate pdf_report N/A templates N/A N/A MyTemplate pdf_template_filename name background N/A N/A N/A document addPageTemplates templates N/A styles N/A getSampleStyleSheet N/A elements N/A N/A NextPageTemplate background N/A N/A N/A elements extend N/A create_toc N/A i N/A range 200 N/A N/A N/A N/A elements append N/A Paragraph N/A Hello World N/A str i N/A styles N/A Heading1 N/A N/A N/A document multiBuild elements N/A N/A N/A pdf_report close N/A N/A N/A __name__ __main__ N/A N/A N/A template N/A N/A sys argv N/A 1 N/A output N/A platypus_pdf_template. N/A N/A N/A os path basename template N/A N/A create_pdf output template