Templated-docs Documentation

Similar documents
Converting.odt (Open Office Document) to (MS Word).doc in console / terminal on Linux and FreeBSD

OnDemand Discovery Quickstart Guide

How to apply: The online application process explained step by step

2. Installation The name and accessibility of menus can differ by mobile OS. The steps to follow can differ as well.

Cracked Character Count Tool pc software download free full ]

How to Join a Phone Conference

BOARD PORTAL FOR ADMINSTRATORS STEP BY STEP QUICK GUIDE THIS GUIDE IS UPDATED FOR WEBVERSION 4.1 AND IOS APP-VERSION 4.2

. Click on the File Sharing link to access File Sharing..

VALO Cloud 2.0 User Guide

KNIME workflow with the reporting functionality manual

Genesis Webinar-To-Go Quick Reference Guide

to PDF. For Outlook Export s & attachments to PDF. Bahrur Rahman AssistMyTeam

User Guide Storebox Mobile App. User Guide. Swisscom AG. Swisscom AG 1/51

FILE SHARING OVERVIEW HOW DO I ACCESS FILE SHARING? NAVIGATION

django-intercom Documentation

Frequently Asked Questions. Question # Page #

Getting Started for XTM Cloud Enterprise

How to Host an Online Meeting

Uploading a File in the Desire2Learn Content Area

New Look for the My Goals Page

Document Version: 1.0. Purpose: This document provides an overview of IBM Clinical Development v released by the IBM Corporation.

Creating and Sharing a VoiceThread

NAS 256 DataSync for Microsoft OneDrive. Backup data from Microsoft OneDrive to your NAS

Google Docs. Table of Contents. About Google Docs 3. Access Google Docs 3. Google Docs Home Page 3. Creating a New Doc 4.

SharePoint Attachment Extractor and Metadata Manager for Microsoft Dynamics CRM. Release Notes

EXT: powermail2document

OPERATOR MANUAL > MOPS. mobile printing solution. Version 1.0. Stand Jul-16

CREATING A REPORT TEMPLATE TO USE IN MAGICDRAW user guide

PEERNET File Conversion Center

Publitas e-docconverter API User Guide Publitas e-docconverter API User Guide

ASSIGNMENT TOOL TRAINING

Workshare Protect Server 3.0. Release Notes

How to submit an assignment to Turnitin full student guide

File Upload extension User Manual

Pegasus. The online ISIN Application system. Step 1: Requestor Details. Version 1.1

JoomDOC Documentation

VoiceThread Instructions

Ms Dos Commands List With Examples Ppt

INFORMZ USER GUIDE: The Asset Manager

(Frequently Asked Questions)

DOWNLOAD OR READ : FREE SERVICE MANUAL 2006 GMC SIERRA PDF EBOOK EPUB MOBI

Any references to company names in screenshots are for demonstration purposes only and are not intended to refer to any actual organization.

bbc Adobe LiveCycle Content Services Mobile System requirements APPLIES TO Server CONTENTS iphone License information

Comparison Chart Reporting Tools

WORKSHARE PROTECT SERVER 3.6 RELEASE NOTES

PDF Converter 1.0 User Guide

PDF Converter 1.0 User Guide

django-debreach Documentation

Thanks for uploading to Scribd in the past! To make Scribd an active and valuabl e community,

Verba Recording System 7

Instructions for Using Events

Features & Functionalities

FinalCode Viewer User Manual

OPSWAT Metadefender. Superior Malware Threat Prevention and Analysis

Workshare for iphone/ipad. Getting Started Guide

BlackBerry Workspaces Server Administration Guide

Koalix ERP. Release 0.2

BVCC General Meeting. April 9, The LibreOffice Free Office Suite, Joel Ewing

Digital Signs 101. Learning the Content Manager Express (CMX) Web App Enterprise Digital Signage Training. Page! 1 of! 17

WebSpace - Creating Content, Pages, And Posts

DOWNLOAD OR READ : CONVERTING WORD DOCUMENT TO FORM PDF EBOOK EPUB MOBI

Enolsoft PDF Converter with OCR Tutorial

django-avatar Documentation

Features & Functionalities

DOWNLOAD OR READ : A LINK TO THE PAST WIKI GUIDE PDF EBOOK EPUB MOBI

Updated 7/27/15. Cougar Link. Utilizing News, Rosters, Galleries and Documents for Your Organization

HOW TO UPLOAD FILE IN SELENIUM WEBDRIVER C

django-avatar Documentation

WHITE PAPER WEB CACHE DECEPTION ATTACK. Omer Gil. July

WebReport/i. Dropbox Feature. Version 13. As of April Kisco Information Systems 89 Church Street Saranac Lake, New York 12983

Django File Picker Documentation

Getting Started Guide. Appendix B Open Source, Open Standards, OpenDocument

NBCS IT Fact Sheet. NBCS Policy: Social Networking sites, digital media and cyber bullying

ABBYY FineReader 14 Full Feature List

Bootcamp. Share your data: Using a team display with Open Source software PalMA

IBM Sametime Web Client & Meeting Server - An Introduction to new features in version 9.0.1

TABLE OF CONTENTS SECTION 1- ORGANIZATION 1-2 SECTION 2- GOOGLE DOCS 3-4 SECTION 3- GOOGLE PRESENTATIONS 5-6 SECTION 4- GOOGLE SPREADSHEETS 7-8

Apache OpenOffice.org Community Wiki

Quick Start Guide. Managing the Service. Converting Files and Folders

HTM, HTML, MHT, MHTML Web document Brightspace Learning Environment strips the <title> tag and text within the tag from user created web documents

Mail Merge - Create Letter

FinalCode Viewer User Manual

WORKSHARE PROTECT SERVER 3.6

DOWNLOAD OR READ : TEXT AND IMAGE PDF EBOOK EPUB MOBI

fragapy Documentation

EDITING CONTENT LOGGING IN. Login via CAS login. Navigate to your page, and click on New Draft at the bottom of the page

ScholarOne Manuscripts. Author File Upload Guide

23 - Report & Export

AVS4YOU Programs Help

DOWNLOAD OR READ : THE WORD AND THE SPIRIT PDF EBOOK EPUB MOBI

Grails Jasper Plugin - Reference Documentation. Puneet Behl. Version RC1

Getting Started Guide. Chapter 1 Introducing LibreOffice

django-messages Documentation

DOWNLOAD OR READ : WHEN YOU ARE CONVERTED PDF EBOOK EPUB MOBI

Document Viewer 2.0 User Guide

Getting Started Guide. Appendix B Open Source, Open Standards, OpenDocument

myprint help topics myprint account Creating a myprint account Closing your myprint account

Supported File Types

Administration Guide. BlackBerry Workspaces. Version 5.6

Learn Html Pdf Convert To Word Full Version For Windows 7

Transcription:

Templated-docs Documentation Release 0.3.1 Alex Morozov October 17, 2016

Contents 1 Features 3 2 Installation 5 3 Usage 7 4 More information 9 4.1 Working with document templates.................................... 9 4.2 Useful template tags........................................... 10 4.3 Serving generated documents over HTTP................................ 10 4.4 Management commands for generating documents........................... 11 4.5 Templated-docs settings......................................... 11 i

ii

Templated-docs Documentation, Release 0.3.1 Templated-docs is a Django package that allows you to generate documents, including texts, spreadsheets and presentations, from templates. It utilises LibreOffice as an underlying conversion document mechanism. Contents 1

Templated-docs Documentation, Release 0.3.1 2 Contents

CHAPTER 1 Features Generate any LibreOffice-supported document from within Django. Use Django template language inside office documents. Create custom generation management commands to integrate with other systems. 3

Templated-docs Documentation, Release 0.3.1 4 Chapter 1. Features

CHAPTER 2 Installation To install templated-docs: 1. Make sure you have LibreOffice >= 4.3.0 installed on the same machine 2. Install a package with pip install templated-docs 3. Add templated_docs to INSTALLED_APPS If you are using cpython you may need the libffi development package in order to compile this module s dependencies. Ubuntu: apt-get install libffi-dev MacOS: brew install libffi 5

Templated-docs Documentation, Release 0.3.1 6 Chapter 2. Installation

CHAPTER 3 Usage To generate a document from a template sample.odt you can write a view like this: from templated_docs import fill_template from templated_docs.http import FileResponse def get_document(request): """ A view to get a document filled with context variables. """ context = {'user': request.user, 'foo': 'bar'} filename = fill_template('sample.odt', context, output_format='pdf') visible_filename = 'greeting.pdf' return FileResponse(filename, visible_filename) templated_docs.fill_template(template_name, context, output_format= odt ) Fill a template template_name using a context dictionary as a context, optionally converting it to the output_format. Returns a filename of a generated file. 7

Templated-docs Documentation, Release 0.3.1 8 Chapter 3. Usage

CHAPTER 4 More information 4.1 Working with document templates 4.1.1 Supported formats Important: The templates themselves must be in on of the OpenDocument formats:.odt,.ods,.odp or.odg. Templated-docs can generate documents in any format LibreOffice itself supports. For the moment they are: Text documents: doc, docx, fodt, html, odt, ott, pdf, txt, xhtml, png Spreadsheets: csv, fods, html, ods, ots, pdf, xhtml, xls, xlsx, png Presentations: fodp, html, odg, odp, otp, pdf, potm, pot, pptx, pps, ppt, svg, swf, xhtml, png Drawings: fodg, html, odg, pdf, svg, swf, xhtml, png 4.1.2 Where to put templates Templated-docs uses a standard Django template discovery mechanism, so you should place your documents at a path where other templates reside. Usually it s either a templates directory at the project level, or templates folders in each applications. 4.1.3 What subset of templating language is supported Django templating language is fully supported, including filters and tags. Keep in mind, though, that in order to use custom template tags you should load them first using a standard {% load %} tag. 4.1.4 Looping Generating lines in loops is supported via the standard {% for %} tag. Here s the picture that illustrates the concept: 9

Templated-docs Documentation, Release 0.3.1 4.2 Useful template tags To use these template tags, load them first with {% load templated_docs_tags %}. 4.2.1 lolinebreaks To keep newlines in a multiline text, use this tag instead of a default linebreaks filter: {{ variable lolinebreaks }} 4.2.2 image Inserting images from models ImageField is supported. Assuming you have a claim model instance with a stamp ImageField in it: {% image claim.stamp %} 4.3 Serving generated documents over HTTP A common task is to serve user a created file. To facilitate this, a handy FileResponse response class is available: from templated_docs.http import FileResponse def your_view(self): filename = get_my_document() return FileResponse(filename, visible_name='document.pdf') A FileResponse constructor is a subclass of Django s HttpResponse, providing the following arguments: actual_file - the real filename to serve visible_name - the name a user will see in the browser delete - set this to False to skip file deletion Important: The actual_file is deleted by default after being served, as usually this is the wanted behaviour. To keep the file, pass the delete=false argument to the HttpResponse constructor. 10 Chapter 4. More information

Templated-docs Documentation, Release 0.3.1 4.4 Management commands for generating documents Todo: describe templated_docs.management.base.documentgenerationcommand. 4.5 Templated-docs settings Some settings can be utilised to alter the package behaviour: TEMPLATED_DOCS_LIBREOFFICE_PATH - a path to the LibreOffice installation s program folder. Defaults to /usr/share/libreoffice/program. 4.4. Management commands for generating documents 11