Common use of High-level PDF Library Clause in Contracts

High-level PDF Library. ‌ The focus of rinohtype development is currently on the rinoh tool and Sphinx builder. Use as a Python library is possible, but documentation may be lacking. Please be patient. The most basic way to use rinohtype in an application is to hook up an included frontend, a document template and a style sheet: from rinoh.frontend.rst import ReStructuredTextReader from rinoh.templates import Article # the parser builds a rinohtype document tree parser = ReStructuredTextReader() with open('my_document.rst') as file: document_tree = parser.parse(file) # render the document to 'my_document.pdf' document = Article(document_tree) document.render('my_document') This basic application can be customized to your specific requirements by customizing the document template, the style sheet and the way the document’s content tree is built. The basics of document templates and style sheets are covered in later sections. The document tree returned by the ReStructuredTextReader in the example above can also be built manually. A DocumentTree is simply a list of Flowables, which can have child elements. These children in turn can also have children, and so on; together they form a tree. Here is an example document tree of a short article: from rinoh.document import DocumentTree from rinoh.styleds import * document_tree = DocumentTree( [Paragraph('My Document', style='title'), # metadata! Section([Heading('First Section'), Paragraph('This is a paragraph with some ' + StyledText('emphasized text', style='emphasis') + ' and an ' + InlineImage('image.pdf')), Section([Heading('A subsection'), Paragraph('Another paragraph') ]) ]),

Appears in 2 contracts

Sources: User Manual, User Manual

High-level PDF Library. ‌ The focus of rinohtype development is currently on the rinoh tool and Sphinx builder. Use as a Python library is possible, but documentation may be lacking. Please be patient. The most basic way to use rinohtype in an application is to hook up an included frontend, a document template and a style sheet: from rinoh.frontend.rst import ReStructuredTextReader from rinoh.templates import Article # the parser builds a rinohtype document tree parser = ReStructuredTextReader() with open('my_document.rst') as file: document_tree = parser.parse(file) # render the document to 'my_document.pdf' document = Article(document_tree) document.render('my_document') This basic application can be customized to your specific specific requirements by customizing the document template, the style sheet and the way the document’s content tree is built. The basics of document templates and style sheets are covered in later sections. The document tree returned by the ReStructuredTextReader in the example above can also be built manually. A DocumentTree is simply a list of Flowables, which can have child elements. These children in turn can also have children, and so on; together they form a tree. Here is an example document tree of a short article: from rinoh.document import DocumentTree from rinoh.styleds import * document_tree = DocumentTree( [Paragraph('My Document', style='title'), # metadata! Section([Heading('First Section'), Paragraph('This is a paragraph with some ' + StyledText('emphasized text', style='emphasis') + ' and an ' + InlineImage('image.pdf')), Section([Heading('A subsection'), Paragraph('Another paragraph') ]) ]),

Appears in 1 contract

Sources: User Manual