| Call Details | ||
|---|---|---|
| Customer: | Site: | |
| Name: | John Doe | Banana headquarters |
| Address: |
31 Spooner Street Quahog Cranston Rhode Island |
1407 Greymalkin Lane Salem Center New York ABC 123 |
| Contact Tel: | 0898 221333 | 9262 458787 |
| Notes: | Additional notes go here | |
| C.order No. | 12345 | Machine: | SAMPLE |
| Engineer: | Meter: | 3216549 |
| Faults | ||
|---|---|---|
| Status: | ||
| Description: | ||
| Notes: | ||
| Description: | ||
| Notes: | ||
| Description: | ||
| Notes: | ||
| Description: | ||
| Notes: | ||
| Parts | ||
|---|---|---|
| Qty: | Part No. | Description: |
| 1 | 1234567 | SAMPLE |
| 1 | 1234567 | SAMPLE |
| 1 | 1234567 | SAMPLE |
| 1 | 1234567 | SAMPLE |
| Labour | |||
|---|---|---|---|
| Engineer: | Start | Finish | Total: |
| G.Total: | 0h:0m | ||
| Travel | |||
|---|---|---|---|
| Depart: | Arrive: | Miles: | Time: |
| Totals: | |||
The demo form has been constructed using the built in pretty_html feature which aids in the construction of html using a built in class that automatically handles the opening and closing of html elements.
It can be compiled using the make in this folder. When run it will automatically generate this page in html and the pdf of the same name in this folder.
Margins are set in 3 different places and each can conflict. The margin on this page is set in the stylesheet(in this instance /usr/share/wkgtkprinter/a4-portrait-pdf.css). It can be changed by setting the variable "--page-margin:" towards the top of the stylesheet.When the stylesheet is referenced you will see a red box indicating the margin to aid in designing the form (this box does not appear in the PDF).
Page margins can also be set in the page configuration file "/usr/share/wkgtkprinter/a4-portrait-pdf.page".They default to 0 as margins are handeled in the CSS.
Some applications also set their own page margins when printing. During testing these have been accumulative so if you set a 6mm margin in the CSS and the application's print dialog has a 4mm margin the resultant page will have a 10mm margin.
Each document should use a base stylesheet that is directly linked. Any custom base stylesheets should be stored in "/usr/share/wkgtkprinter" and should be linked using the absolute path.The base style sheet provides you with a template to develop your document.
For pdf development it is better to embed styles rather than have separate css files however wkgtkprinter++' pretty_html can handle this internally if you read an external stylesheet into a <style> element. If you are gong to link them then it is recommended that you place them in a location accessible by wkgtkprinter such as "/usr/share/wkgtkprinter/".
New pages are created by utilising the page and subpage classes.
For the purposes of generating PDF's images are embeded within the HTML. They are base64 encoded which does make them a little larger, but the design decision was taken to prefer reliability over file size.
wkgtkprinter++ has a built in class for encoding images called encode_image (see example).