Difference between revisions of "PDF Updated"

From PresenceWiki
Jump to: navigation, search
 
Line 1: Line 1:
http://www.international-presence.com/images/nodes/dataformatter.png
+
[[file:dataformatter.png]]
  
 
To create a pdf document create a new custom data formatter in your task.
 
To create a pdf document create a new custom data formatter in your task.
Line 6: Line 6:
 
This will then create the template for your pdf instructions.
 
This will then create the template for your pdf instructions.
  
http://www.international-presence.com/images/docs/pdf/dataformatterscreen.png
+
[[file:dataformatterscreen.png]]
  
 
As usual if you enter < then the helper will appear with a list of options and permitteed tags for the pdf.
 
As usual if you enter < then the helper will appear with a list of options and permitteed tags for the pdf.
Line 19: Line 19:
 
then put the file into a task and run it through the pdf formatter to see what is happening.
 
then put the file into a task and run it through the pdf formatter to see what is happening.
  
http://www.international-presence.com/images/docs/pdf/dataformattersave.png
+
[[file:dataformattersave.png]]
  
 
A pdf file can be created using a well structured html.
 
A pdf file can be created using a well structured html.

Latest revision as of 11:43, 7 September 2015

Dataformatter.png

To create a pdf document create a new custom data formatter in your task. Be sure to select 'PDF Document' as the 'Type of document to produce'.

This will then create the template for your pdf instructions.

Dataformatterscreen.png

As usual if you enter < then the helper will appear with a list of options and permitteed tags for the pdf.

Note it is actually the saving option that tells presence to send these instructions through the pdf formatter to generate the file.

To create a pdf file you need to set the 'Write Output' option to 'Into PDF File'

If you were to select 'To File' then the instructions themselves will be saved as pure text. This is useful if you need to send the instructions to us for debugging purposes, as we can then put the file into a task and run it through the pdf formatter to see what is happening.

Dataformattersave.png

A pdf file can be created using a well structured html. Each tag should be terminated with an associated closing tag.

At present only basic formatting is supported, so no style sheets or inline formatting is allowed.

Acceptable tags

pdf

Denotes the start of the pdf

document

Describes the document properties and can have the following attributes

userpassword
ownerpassword
allowprinting
allowcopy
pagenumbers
landscape
header
document header
document footer
pagesize a1 a2 a3 a4 ledger legal letter note 22,33
marginleft
marginright
margintop
marginbottom

p

As in html this describes a new paragraph

table

Similar to html, allows you to create a new table and can have the following attributes

width %
cellpadding
cellspacing
border
positionabs
align
bgcolor
title
caption

As in html to define a new row in the table use <tr> and to define a new cell <td> or <th> which is a header cell and so will be at the top of each page when the table carries over onto the next page.

Cell attributes

colspan
width %
bgcolor
align
valign

page

Denotes a new page

landscape header page header footer page footer pagesize marginleft marginright margintop marginbottom thispageonly

align ol ul li pre

font

font-weight: face type courier helvetica times align left center right justify valign top middle bottom baseline color size + - positionabs bold font-size x-small small

border-width: border-"+strDirection+"-width: border-"+strDirection+"-style: none medium thin px

u strong small big b br

input

type checkbox

img

src align scaleabs scalefit image tag left middle right watermark positionabs i h1 h2 h3 h4 h5 h6 hr


color

Colors can be defined as one of several labels or by hex as in html if you want more control.

For instance green could be specified as either '#00FF00','green'

Presence recognises the following labels as colors:-

black blue cyan darkgray gray green lightgray magenta orange pink red white yellow


example
<font color="#00FF00">I am green text</font>
<td color="blue">This cell will have a blue background</td>'''


Formatting

< < &gt > "","\""); &","&"); \n"," "); \t"," "); replaceAll("[ ]+"," "); replaceAll(" "," ");

intelligent formatting

table headers carried over to next page

&nbsp nowrap

Absolute positioning

Sometimes you need to be specific when positioning text (for instance if the document is going to be scanned by an ocr reader, or if you wish to position an address so that it appears in the right position in a windowed evelope, or if you want to place text in the border).

<font positionabs="575,822">O</font>
<table positionabs="0,0"><tr><td>FF</td></tr></table>

In these instances it can be useful to use absolute positioning.

It's worth noting that an A4 page is 595 units across by 842 units down.

Also depending on the table width the table will be pushed left so that it is not hanging off the right hand side of the page. For instance, if the table width was 50% then the positionabs="500,200" would actually be positioned at 298,200.

For further reading on creating PDFs please see this page.


See Also

Task Elements > Data Format Nodes > PDF Updated

CSV Writer | HTML Table Writer | Basic XML Writer | XML Document Writer
XSLT Processor | Padded Text Writer | Custom Data Formatter Standard Option | Custom Data Formatter PDF Option
Custom Nodes


Task Elements | Resources