PDFApi

Version 23 (Jens Neulen, 28.05.2010 04:55 pm)

1 9 Schorsch Leciejewski
h1(title). PDF API
2 1
3 1
4 7 Schorsch Leciejewski
The SalesKing uses the pdfLib for creating PDF documents. You can customize any generated pdf files (f.ex. Invoice) by uploading PDF templates into the system.
5 1
6 23 Jens Neulen
Customizing the pdf templates is not really difficult. Despite your will to read the docs and spending some time trying, you need Adobe“s Acrobat Professional and a Acrobat Professional Plugin to edit the data placeholders: the "Block plugin":http://www.pdflib.com/download/pdflib-family/block-plugin-35/
7 8 Schorsch Leciejewski
h1. Contents
8 1
9 7 Schorsch Leciejewski
{{toc}}
10 1
11 8 Schorsch Leciejewski
h1. Audience
12 1
13 7 Schorsch Leciejewski
This document is intended for SalesKing users which want to customize the pdf templates. 
14 1
15 19 Schorsch Leciejewski
It assumes that you understand the basics of Adobe Acrobat and the pdfLib-Block plugin. Further you should have some basic knowledge of how to create a pdf file from various resources as well as some graphic design knowledge.
16 1
17 7 Schorsch Leciejewski
For more information about those things, see the Additional resources section at the bottom of this document.
18 7 Schorsch Leciejewski
19 19 Schorsch Leciejewski
If you master the art of pdf customizing you definitely have a sharp knife to cut down on those ugly invoices and official documents ... mostly derived from Word or other non-layout-suited Software.
20 7 Schorsch Leciejewski
21 7 Schorsch Leciejewski
22 8 Schorsch Leciejewski
h1. PDF Templates in General
23 3 Schorsch Leciejewski
24 18 Schorsch Leciejewski
A pdf template can be any pdf file. but first the normal steps you take in customizing:
25 3 Schorsch Leciejewski
26 18 Schorsch Leciejewski
# make a layout in photoshop / indesign / gimp / freehand
27 3 Schorsch Leciejewski
# generate a pdf
28 18 Schorsch Leciejewski
# download one of our default templates (or start from scratch)
29 18 Schorsch Leciejewski
# open acrobat writer and export the blocks from the default template to your new pdf. (Check the Block plugin menu to see all options)
30 4 Schorsch Leciejewski
# customize the blocks on you new pdf (block size/text/font/position/content/..)
31 1
# upload the pdf into SalesKing  
32 3 Schorsch Leciejewski
# check the output 
33 3 Schorsch Leciejewski
34 8 Schorsch Leciejewski
h2. Conventions
35 20 Schorsch Leciejewski
36 18 Schorsch Leciejewski
There is a small set of conventions you need to follow:
37 4 Schorsch Leciejewski
38 10 Schorsch Leciejewski
* all fonts used in blocks must be present on the system generating the output pdf (our server)
39 20 Schorsch Leciejewski
* The fontnames are case sensitive
40 3 Schorsch Leciejewski
* Block names must match a special syntax (also see [[Placeholders]]) 
41 18 Schorsch Leciejewski
* the template size should not exceed 1mb
42 1
43 12 Schorsch Leciejewski
h1. Template Blocks
44 6 Schorsch Leciejewski
45 6 Schorsch Leciejewski
A Block is placeholder which gets substituted with data/text from the system. 
46 14 Schorsch Leciejewski
It is not required to have a standard set of blocks in a template. 
47 6 Schorsch Leciejewski
48 6 Schorsch Leciejewski
49 8 Schorsch Leciejewski
h2. Block name
50 6 Schorsch Leciejewski
51 10 Schorsch Leciejewski
The block name defines the matching data field from the application.
52 10 Schorsch Leciejewski
If no matching data field can be found the block is left empty.
53 1
54 13 Schorsch Leciejewski
Example of blocknames:
55 1
56 10 Schorsch Leciejewski
<pre>
57 15 Schorsch Leciejewski
number
58 10 Schorsch Leciejewski
client.address_field
59 15 Schorsch Leciejewski
page_number
60 10 Schorsch Leciejewski
settings.footer
61 10 Schorsch Leciejewski
</pre>
62 10 Schorsch Leciejewski
63 10 Schorsch Leciejewski
64 6 Schorsch Leciejewski
h2. Block position
65 6 Schorsch Leciejewski
66 15 Schorsch Leciejewski
The data/text is rendered at the position of the block. Depending on the block properties (f.ex. type:textline, textflow, image, align) the actual placement of the text can be influenced. 
67 1
68 1
h2. Block properties
69 1
70 13 Schorsch Leciejewski
The block properties carry information about how to output the data. 
71 10 Schorsch Leciejewski
72 6 Schorsch Leciejewski
The deep details of all block properties can be studied in the pdfLib API and the block manual. 
73 1
Therefore here just a list of options you are likely to use frequently:
74 1
75 13 Schorsch Leciejewski
|_.Property|_.Description|
76 13 Schorsch Leciejewski
|font + fontsize|the font must be present on our system!|
77 1
|textflow |mutiline text blocks must use this option which reveals more settings for the text flow|
78 1
|textflow alignment |text alignment in texflow boxes|
79 1
|custom properties| values defined by the SalesKing - depending on template type|
80 14 Schorsch Leciejewski
81 14 Schorsch Leciejewski
h2. Custom Block properties
82 14 Schorsch Leciejewski
83 14 Schorsch Leciejewski
Some blocks go beyond simple text rendering, f.ex. the invoice items table or page numbers.
84 14 Schorsch Leciejewski
You can influence such output with a set of custom fields. The custom property name and values are described inside the specific template type.
85 14 Schorsch Leciejewski
86 14 Schorsch Leciejewski
*Custom property detection*
87 14 Schorsch Leciejewski
88 14 Schorsch Leciejewski
To make sure a template can be handled, we have a multi-stage fallback mechanism for (most) custom properties.
89 14 Schorsch Leciejewski
90 14 Schorsch Leciejewski
It is important to know the way of property detection, to understand why something comes out like it does.
91 14 Schorsch Leciejewski
92 14 Schorsch Leciejewski
The option stages in their order of detection/use:
93 14 Schorsch Leciejewski
94 14 Schorsch Leciejewski
# settings inside the template“s custom block property
95 14 Schorsch Leciejewski
# user settings inside the SalesKing
96 14 Schorsch Leciejewski
# hardcoded options from the SalesKing core
97 14 Schorsch Leciejewski
98 14 Schorsch Leciejewski
If any setting is empty we go down the line and use the next available.
99 13 Schorsch Leciejewski
100 1
101 16 Schorsch Leciejewski
h3. show_on_page - Show a Block only on some pages
102 16 Schorsch Leciejewski
103 16 Schorsch Leciejewski
This custom property is available to all blocks.
104 16 Schorsch Leciejewski
105 16 Schorsch Leciejewski
|_.Property Name|_.Type|_.Example|_.Description|_.Available Markup|
106 16 Schorsch Leciejewski
|show_on_page|String|last|Show a block only on some of the generated pdf pages.|*last* => only on last page, *first* => show only on first page, *any number* => show on page with this number |
107 16 Schorsch Leciejewski
108 17 Ole Wiemeler
!http://pm.salesking.eu/attachments/download/43! 
109 16 Schorsch Leciejewski
110 22 Schorsch Leciejewski
h1. Fonts available
111 22 Schorsch Leciejewski
112 22 Schorsch Leciejewski
We have a couple of Free fonts available. If you have a commercial font(and a license for it), we are glad to make it available for you. 
113 21 Schorsch Leciejewski
114 21 Schorsch Leciejewski
Aller Bold.ttf
115 21 Schorsch Leciejewski
Aller Light.ttf
116 21 Schorsch Leciejewski
Aller.ttf
117 21 Schorsch Leciejewski
Anivers-Regular.otf
118 21 Schorsch Leciejewski
Arial.ttf
119 21 Schorsch Leciejewski
Ariblk.ttf
120 21 Schorsch Leciejewski
BergamoStd-Bold.otf
121 21 Schorsch Leciejewski
BergamoStd-Regular.otf
122 21 Schorsch Leciejewski
Calibri Bold Italic.ttf
123 21 Schorsch Leciejewski
Calibri Bold.ttf
124 21 Schorsch Leciejewski
Calibri Italic.ttf
125 21 Schorsch Leciejewski
Calibri.ttf
126 21 Schorsch Leciejewski
Cambria Bold Italic.ttf
127 21 Schorsch Leciejewski
Cambria Bold.ttf
128 21 Schorsch Leciejewski
Cambria Italic.ttf
129 21 Schorsch Leciejewski
Cambria.ttf
130 21 Schorsch Leciejewski
Candara Bold Italic.ttf
131 21 Schorsch Leciejewski
Candara Bold.ttf
132 21 Schorsch Leciejewski
Candara Italic.ttf
133 21 Schorsch Leciejewski
Candara.ttf
134 21 Schorsch Leciejewski
Candela-Bold.otf
135 21 Schorsch Leciejewski
Candela-Book.otf
136 21 Schorsch Leciejewski
Caviar Dreams Bold.ttf
137 21 Schorsch Leciejewski
Caviar Dreams.ttf
138 21 Schorsch Leciejewski
Cicle_Gordita.ttf
139 21 Schorsch Leciejewski
Cicle_Semi.ttf
140 21 Schorsch Leciejewski
Consolas Bold Italic.ttf
141 21 Schorsch Leciejewski
Consolas Bold.ttf
142 21 Schorsch Leciejewski
Consolas Italic.ttf
143 21 Schorsch Leciejewski
Consolas.ttf
144 21 Schorsch Leciejewski
Constantia Bold Italic.ttf
145 21 Schorsch Leciejewski
Constantia Bold.ttf
146 21 Schorsch Leciejewski
Constantia Italic.ttf
147 21 Schorsch Leciejewski
Constantia.ttf
148 21 Schorsch Leciejewski
contra.ttf
149 21 Schorsch Leciejewski
Corbel Bold Italic.ttf
150 21 Schorsch Leciejewski
Corbel Bold.ttf
151 21 Schorsch Leciejewski
Corbel Italic.ttf
152 21 Schorsch Leciejewski
Corbel.ttf
153 21 Schorsch Leciejewski
DejaVu Fonts License.txt
154 21 Schorsch Leciejewski
DejaVu Sans Bold.ttf
155 21 Schorsch Leciejewski
DejaVu Sans Condensed Bold.ttf
156 21 Schorsch Leciejewski
DejaVu Sans Condensed.ttf
157 21 Schorsch Leciejewski
DejaVu Sans.ttf
158 21 Schorsch Leciejewski
DejaVu Serif Bold.ttf
159 21 Schorsch Leciejewski
DejaVu Serif Condensed Bold.ttf
160 21 Schorsch Leciejewski
DejaVu Serif Condensed.ttf
161 21 Schorsch Leciejewski
DejaVu Serif.ttf
162 21 Schorsch Leciejewski
Delicious-Bold.otf
163 21 Schorsch Leciejewski
Delicious-Roman.otf
164 21 Schorsch Leciejewski
Droid Sans Bold.ttf
165 21 Schorsch Leciejewski
Droid Sans.ttf
166 21 Schorsch Leciejewski
Dustismo  Bold.ttf
167 21 Schorsch Leciejewski
dustismo.ttf
168 21 Schorsch Leciejewski
FontinSans-Bold.otf
169 21 Schorsch Leciejewski
FontinSans-Regular.otf
170 21 Schorsch Leciejewski
Gentium Basic Bold.ttf
171 21 Schorsch Leciejewski
Gentium Basic.ttf
172 21 Schorsch Leciejewski
Gentium Book Basic Bold.ttf
173 21 Schorsch Leciejewski
Gentium Book Basic.ttf
174 21 Schorsch Leciejewski
Georgiab.ttf
175 21 Schorsch Leciejewski
Georgia.ttf
176 21 Schorsch Leciejewski
lmsans10-bold.otf
177 21 Schorsch Leciejewski
lmsans10-regular.otf
178 21 Schorsch Leciejewski
lmsansdemicond10-regular.otf
179 21 Schorsch Leciejewski
New Cicle Fina.ttf
180 21 Schorsch Leciejewski
New Cicle Gordita.ttf
181 21 Schorsch Leciejewski
New Cicle Semi.ttf
182 21 Schorsch Leciejewski
Perspective Sans Bold.ttf
183 21 Schorsch Leciejewski
Perspective Sans.ttf
184 21 Schorsch Leciejewski
Pigiarniq Regular.ttf
185 21 Schorsch Leciejewski
Sansation Bold.ttf
186 21 Schorsch Leciejewski
Sansation Light.ttf
187 21 Schorsch Leciejewski
Sansation Regular.ttf
188 21 Schorsch Leciejewski
VeraBd.ttf
189 21 Schorsch Leciejewski
VeraMoBd.ttf
190 21 Schorsch Leciejewski
VeraMono.ttf
191 21 Schorsch Leciejewski
VeraSeBd.ttf
192 21 Schorsch Leciejewski
VeraSe.ttf
193 21 Schorsch Leciejewski
Verdanab.ttf
194 21 Schorsch Leciejewski
Verdana.ttf
195 21 Schorsch Leciejewski
vollkorn.otf
196 21 Schorsch Leciejewski
YanoneKaffeesatz-Bold.otf
197 21 Schorsch Leciejewski
YanoneKaffeesatz-Light.otf
198 21 Schorsch Leciejewski
YanoneKaffeesatz-Regular.otf
199 21 Schorsch Leciejewski
200 16 Schorsch Leciejewski
201 11 Schorsch Leciejewski
h1. Template Types & Details
202 11 Schorsch Leciejewski
203 12 Schorsch Leciejewski
Jump to a template type to read more about the implementation details:
204 11 Schorsch Leciejewski
205 11 Schorsch Leciejewski
* [[PDFApi Invoice Templates|Invoice Templates]]
206 7 Schorsch Leciejewski
207 1
h1. Additional Resources
208 7 Schorsch Leciejewski
209 23 Jens Neulen
* "pdfLib Block plugin for Acrobat Professional":http://www.pdflib.com/download/pdflib-family/block-plugin-35/
210 7 Schorsch Leciejewski
* "German pdfLib Manual":http://www.pdflib.com/de/developer/technische-dokumente/handbuecher/