Examples and Cookbook

Basic

These examples show how to use TBS's syntax "field" and "block" in templates.

Document Zip method Template PHP function
OpenOffice Word basic.odt shell basicSuccess.odt executeBasic
OpenOffice Spreadsheet basicCalc.ods shell basicCalcSuccess.ods executeBasicCalc
Word 2007 basicWord.docx shell basicWordSuccess.docx executeBasicWord

Charset

These examples are for testing for specials characters.

Document Zip method Template PHP function
OpenOffice Word charset.odt shell charsetSuccess.odt executeCharset
OpenOffice Spreadsheet charset.ods shell charsetSuccess.ods
OpenOffice 1.0 Text charset.sxw shell charsetSuccess.sxw
OpenOffice 1.0 Calc charset.sxc shell charsetSuccess.sxc
Word 2007 charset.docx shell charsetSuccess.docx

Merge with database

These examples show how to merge with a database.

Document Zip method Template PHP function
Merge with an array
OpenOffice Word blogPost.odt shell blogPostSuccess.odt executeBlogPost
OpenOffice Spreadsheet blogPost.ods shell blogPostSuccess.ods
Word 2007 blogPost.docx shell blogPostSuccess.docx
Merge with the Doctrine method $result->toArray(true)
OpenOffice Spreadsheet blogPostDoctrine.ods shell blogPostDoctrineSuccess.ods executeBlogPostDoctrine

Merge with object

These examples show how to merge with an object.

Document Zip method Template PHP function
OpenOffice Word class.odt ziparchive classSuccess.odt executeClass
Word 2007 class.docx ziparchive classSuccess.docx

Add a file into document

These examples show how to add files in the document, like a picture.

Document Zip method Template PHP function
OpenOffice Word fileShell.odt shell fileShellSuccess.odt executeFileShell
Word 2007 fileShell.docx shell fileShellSuccess.docx
OpenOffice Word fileZiparchive.odt ziparchive fileZiparchiveSuccess.odt executeFileZiparchive

Parameter 'image'

These examples show how to merge pictures with differents values for the parameter.

Document Parameter Zip method Template PHP function
Merge with a field
OpenOffice Word image.odt image shell imageSuccess.odt executeImage
OpenOffice Spreadsheet image.ods image shell imageSuccess.ods
Merge with a block
OpenOffice Word imageBlock.odt image shell imageBlockSuccess.odt executeImageBlock
OpenOffice Word imageBlock.odt image ziparchive imageBlockSuccess.odt
Merge with a block
OpenOffice Word imageBlockFruit.odt image=100% shell imageBlockFruitSuccess.odt executeImageBlockFruit
OpenOffice Word imageBlockFruit25.odt image=25% shell imageBlockFruit25Success.odt executeImageBlockFruit25
Merge with a block in a table
OpenOffice Word imageBlockFruitTable.odt image=25% shell imageBlockFruitTableSuccess.odt executeImageBlockFruitTable
OpenOffice Word imageBlockFruitTableFit.odt image=fit shell imageBlockFruitTableFitSuccess.odt executeImageBlockFruitTableFit
OpenOffice Word imageBlockFruitTableMax.odt image=max shell imageBlockFruitTableMaxSuccess.odt executeImageBlockFruitTableMax
Thumbnails
OpenOffice Word imageBlockThumbTableFit.odt image=fit shell imageBlockThumbTableFitSuccess.odt executeImageBlockThumbTableFit
OpenOffice Word imageBlockThumbTableMax.odt image=max shell imageBlockThumbTableMaxSuccess.odt executeImageBlockThumbTableMax

TIPS

tip #1 : Set the TBS tags for word processing image

To open the dialox box, right click on picture, then click on 'Pictures...'

OpenOffice word processing dialog box picture options

tip #2 : Set the TBS tags for spreadsheet image

To open the dialox box, right click on picture, then click on 'Names...'

OpenOffice spreadsheet dialog box picture name

NOTE

note #1 : only for OpenDocument

note #2 : images in a spreadsheet can't be merged in within a block, due to the image position refer to the page, not the cell.

Parameter 'link' to transform to linkable text

Document Parameter Zip method Template PHP function
OpenOffice Word link.odt link shell linkSuccess.odt executeLink
OpenOffice Spreadsheet link.ods link shell linkSuccess.ods
OpenOffice Spreadsheet linkBlock.ods link shell linkBlockSuccess.ods executeLinkBlock

NOTE

note #1 : only for OpenDocument

Parameter 'type' to transform to native OpenDocument (OpenOffice) format

Document Parameter Zip method Template PHP function
OpenOffice Spreadsheet tableCellFormat.ods type shell tableCellFormatSuccess.ods executeTableCellFormat
OpenOffice Spreadsheet tableCellFormatBlock.ods type shell tableCellFormatBlockSuccess.ods executeTableCellFormatBlock
OpenOffice Spreadsheet tableCellFormula.ods type shell tableCellFormulaSuccess.ods executeTableCellFormula

TIPS

tip #1 : Set the format in cell

To open the dialox box, right click on cell, then click on 'Format Cells...'

OpenOffice spreadsheet dialog box format cells

NOTE

note #1 : only for OpenDocument

note #2 : only for spreadsheets (not working in word processing tables)

An order

Document Zip method Template PHP function
OpenOffice Word order.odt shell orderSuccess.odt executeOrder