PDFApi
Version 2 (Schorsch Leciejewski, 03.03.2008 02:41 pm)
| 1 | 1 | h1. PDF API |
|
|---|---|---|---|
| 2 | 1 | ||
| 3 | 1 | ||
| 4 | 1 | The SalesKing uses the pdfLib for rendering PDF´s. |
|
| 5 | 1 | ||
| 6 | 1 | To customize the look of a pdf(f.ex. Invoice) one can upload a PDF Template. |
|
| 7 | 1 | ||
| 8 | 1 | ||
| 9 | 1 | To customize any pdf output files you need the Acrobat Writer and the "Block plugin":http://www.pdflib.com/de/download/pdflib-familie/block-plugin/ |
|
| 10 | 1 | ||
| 11 | 1 | ||
| 12 | 1 | h2. Invoice PDF´s |
|
| 13 | 1 | ||
| 14 | 1 | ||
| 15 | 1 | ||
| 16 | 2 | Schorsch Leciejewski | h3. Blocknames == Placeholders |
| 17 | 1 | ||
| 18 | 1 | ||
| 19 | 2 | Schorsch Leciejewski | Each blockname must be made up of a prefix, to specify the data realm, followed by the data field divided by a dot: |
| 20 | 1 | ||
| 21 | 1 | ||
| 22 | 1 | <pre> |
|
| 23 | 1 | invoice.number -> realm invoice field number |
|
| 24 | 1 | client.number -> realm client, field number |
|
| 25 | 1 | user.organisation -> realm user, the organisation of the current user |
|
| 26 | 1 | settings.company_info -> realm settings (invoice print settings), field company_info |
|
| 27 | 1 | </pre> |
|
| 28 | 1 | ||
| 29 | 1 | Available Realms: |
|
| 30 | 1 | ||
| 31 | 1 | ||*Realm*||*Description*|| |
|
| 32 | 1 | ||invoice||Data of the invoice|| |
|
| 33 | 1 | ||client||the invoice reciever, your client|| |
|
| 34 | 1 | ||user||the user creating this invoice|| |
|
| 35 | 1 | ||company||the company the user creating this invoice belongs to|| |
|
| 36 | 1 | ||settings||the invoice print setting fields|| |
|
| 37 | 1 | ||
| 38 | 2 | Schorsch Leciejewski | h3. Invoice items block and table |
| 39 | 1 | ||
| 40 | 1 | The invoice items need some special handling, since it is not possible to define a table in a placeholder block. |
|
| 41 | 1 | ||
| 42 | 1 | You must create a block with the name *invoice.items*. |
|
| 43 | 1 | ||
| 44 | 1 | Some of the blocks normal properties are applied to the table and there is a set of custom properties to further format the output. |
|
| 45 | 1 | ||
| 46 | 1 | All other block properties are not relevant! |
|
| 47 | 1 | ||
| 48 | 1 | General Properties defined in the block, which will be used: |
|
| 49 | 1 | ||
| 50 | 1 | ||*Property*||*Description*|| |
|
| 51 | 1 | ||Rect||The table will be placed into the rectangle defined by the block outlines.|| |
|
| 52 | 1 | ||
| 53 | 1 | Text Properties: |
|
| 54 | 1 | ||
| 55 | 1 | ||*Property*||*Description*|| |
|
| 56 | 1 | ||fontname||The font for all text in the table. The font MUST be present as a system font on our server(see debian fonts), if not no text is visible|| |
|
| 57 | 1 | ||fontsize||The fontsize for all text in the table|| |
|
| 58 | 1 | ||
| 59 | 1 | ||
| 60 | 1 | Custom table block properties (invoice items): |
|
| 61 | 1 | ||
| 62 | 1 | We are serving those as defaults from the system, but you can override them. |
|
| 63 | 1 | If you are redefining those you *MUST* define the following properties: |
|
| 64 | 1 | * columns (which columns to show) |
|
| 65 | 1 | * header (the heading for each column) |
|
| 66 | 1 | ||
| 67 | 1 | Optional |
|
| 68 | 1 | * align (alignment of the columns contents) |
|
| 69 | 1 | * width (width of a column) |
|
| 70 | 1 | * types (the column type) |
|
| 71 | 1 | ||
| 72 | 1 | All custom properties are divided by comma, where the comma defines the column for which the setting will be applied. |
|
| 73 | 1 | ||
| 74 | 1 | Spaces before and after the comma are removed, so you can use them for better readability |
|
| 75 | 1 | ||
| 76 | 1 | <pre> |
|
| 77 | 1 | my property, my property, my property |
|
| 78 | 1 | ||
| 79 | 1 | setting for column 1, setting for column 2, setting for column 3 |
|
| 80 | 1 | </pre> |
|
| 81 | 1 | ||
| 82 | 1 | *Custom Block Properties* |
|
| 83 | 1 | ||
| 84 | 1 | ||*Property*||*Type*||*Example*||*Description*||*Available Markup*|| |
|
| 85 | 1 | ||columns||string||description,product_name,tax, price_single||The columns(in their order) to show in the items table. If empty a set of default columns will be applied.||position , quantity , quantity_unit , price_single , description , discount , tax , product_name price_total , price_tax , price_total_with_tax , price_total_without_discount, quantity_with_unit, name_with_description|| |
|
| 86 | 1 | ||header||string||Description,Product,Tax, Single Price||The column header texts(in their order). If empty no heading will be shown.||Whatever you like to name them. Just remember that commas define the next column header!|| |
|
| 87 | 1 | ||width||string||20,30,250||The columns width. You can define the width for all or just until a column like 1-3. the remaining column will just take the space they need or get||any number|| |
|
| 88 | 1 | ||align||string||left,left,right,right||The columns text alignment. You can define the alignment for all or just until a column like 1-3. The default is left alignment||right,left,center|| |
|
| 89 | 1 | ||types||string||line,line,text||The columns type. if a columns is of type: text it will be rendered as textflow oposed to a single line output. This should only apply to your product description. You should hardly need this setting because every string longer than 20 chars will be treated as textflow||line: a simple textline, text: a multiline text|| |