IbexPDFCreator
DevelopersGuide
Tables
85
Figure15-13:
Tablewithimplicit
rows
row 1 1 column 1
row 1 column 2
row 2 2 column 1
row 2 column 2
15.5 Tablecolumns
Thetable-columnelementisusedtosetthecolumnwidthandothercharacteristicsofa
table column. A table-column element t has s an associated column number which
determineswhichcolumnthetable-columnelementrefersto.Thiscolumnnumberis
eitherimplied(withthe firsttable-columnelement applyingtothe firstcolumn, the
secondtothenextetc.),orexplicitlysetusingthecolumn-numberattribute.
Asingletable-columnelementcanbeusedtodefinethestyleofmultiplecolumnsby
usingthenumber-columns-spannedattribute.
Figure15-14showstheFOforatablewithtwotable-columnelements,whichapplyto
thefirstandsecondcolumns.Inthiscasetheysetthecolumnwidths(to30%and70%),
andthegivethesecondcolumnashadedbackground.TheoutputcreatedfromtheFO
appearsinFigure15-15.
Figure15-14:
FOusingtable-column
elements
<table>
<table-column column-width='30%'/>
<table-column column-width='70%'
background-color='#dddddd'/>
<table-body>
<table-row>
<table-cell border='1pt t solid blue' padding='2pt'>
<block>row 1 1 column 1</block>
</table-cell>
<table-cell border='1pt t solid blue' padding='2pt'>
<block>row 1 1 column 2</block>
</table-cell>
</table-row>
<table-row>
<table-cell border='1pt solid blue' ' padding='2pt'>
<block>row 2 column n 1</block>
</table-cell>
<table-cell border='1pt solid blue' ' padding='2pt'>
<block>row 2 column n 2</block>
</table-cell>
</table-row>
</table-body>
Figure15-15:
Tablewithdefined
columnwidths
row 1 1 column 1
row 1 1 column 2
row 2 2 column 1
row 2 2 column 2
Somecellattributessuchasbackgroundcoloraredeterminedusingattributesfromthe
cellitselfandfromtheotherelementsofthetablestructure.Theorderofprecedencein
determining cell characteristics such h as background-color r is table-celltable-row,
table-body,table-columnandfinallytable.
15.6 Proportionalcolumnwidths
Columnscanbeallocatedwidthswhichareproportionaltothewidthsofothercolumns.
Forexample,ifwehavetwocolumnsandwanttogivethefirstcolumntwicethewidth
Batch pdf compression - Compress reduce PDF size in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
C# Code & .NET API to Compress & Decompress PDF Document
adjust pdf size preview; pdf file compression
Batch pdf compression - VB.NET PDF File Compress Library: Compress reduce PDF size in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
VB.NET PDF Document Compression and Decompression Control SDK
pdf file size; change font size in pdf form
IbexPDFCreator
DevelopersGuide
86
Tables
of the e second, we canspecifycolumnwidths usingthe proportional-column-width()
function as s shown n in Figure 15-16. The total of the values used d in n the
proportional-column-width()functionsis3(2+1),sothefirstcolumnwillgave2/3ofthe
widthandthesecond1/3.TheoutputfromthisFOappearsinFigure15-17.
Figure15-16:
FOusingproportional
columnwidths
<table>
<table-column
column-width='proportional-column-width(2)'/>
<table-column
column-width='proportional-column-width(1)'
background-color='#dddddd'/>
<table-body>
<table-row>
<table-cell border='1pt t solid blue' padding='2pt'>
<block>row 1 1 column 1</block>
</table-cell>
<table-cell border='1pt t solid blue' padding='2pt'>
<block>row 1 1 column 2</block>
</table-cell>
</table-row>
<table-row>
<table-cell border='1pt solid blue' ' padding='2pt'>
<block>row 2 column n 1</block>
</table-cell>
<table-cell border='1pt solid blue' ' padding='2pt'>
<block>row 2 column n 2</block>
</table-cell>
</table-row>
</table-body>
Figure15-17:
Outputfrom
proportionalwidth
example
row 1 1 column 1
row 1 1 column 2
row 2 2 column 1
row 2 2 column 2
15.7 Spanningcolumnsandrows
The number of f columns which a a cell spans s is set t by y the number-columns-spanned
attribute.AnexampleFOforthisisshowninFigure15-18.Inthisexamplethefirstcellof
thefirstrowspanstwocolumns.TheoutputfromthisFOappearsinFigure15-19.
Figure15-18:
FOforcellspanning2
columns
<table>
<table-column column-width="30%"/>
<table-column column-width="70%"
background-color="#dddddd"/>
<table-body>
<table-row>
<table-cell border="1pt t solid blue" padding="2pt"
number-columns-spanned="2">
<block>row 1 1 column 1</block>
</table-cell>
</table-row>
<table-row>
<table-cell border="1pt solid blue" " padding="2pt">
<block>row 2 column n 1</block>
</table-cell>
<table-cell border="1pt solid blue" " padding="2pt">
<block>row 2 column n 2</block>
</table-cell>
</table-row>
</table-body>
C# PDF Convert to Tiff SDK: Convert PDF to tiff images in C#.net
Powerful .NET control to batch convert PDF documents to tiff format and multipage tiff image files can be created from PDF. Supports tiff compression selection.
pdf page size may not be reduced; pdf text box font size
C# Create PDF from Tiff Library to convert tif images to PDF in C#
NET component for batch converting tiff images to PDF documents in C# class. Description: Convert to PDF with specified compression method and save it on
adjust pdf page size; reduce pdf file size
IbexPDFCreator
DevelopersGuide
Tables
87
Figure15-19:
Cellspanningtwo
columns
row 1 1 column 1
row 2 2 column 1
row 2 2 column 2
Thenumberofrowswhichacellspansissetbythenumber-rows-spannedattribute.
ExampleFOforthisisshowninFigure15-20.Inthisexamplethefirstcellofthefirstrow
spanstworows.TheoutputfromthisFOappearsinFigure15-21.
Figure15-20:
FOforcellspanning
tworows
<table>
<table-column column-width='30%'/>
<table-column column-width='70%'
background-color='#dddddd'/>
<table-body>
<table-row>
<table-cell border='1pt t solid blue' padding='2pt'
number-rows-spanned='2'>
<block>row 1 1 column 1</block>
</table-cell>
<table-cell border='1pt solid blue' ' padding='2pt'>
<block>row 1 column n 2</block>
</table-cell>
</table-row>
<table-row>
<table-cell border='1pt solid blue' ' padding='2pt'>
<block>row 2 column n 2</block>
</table-cell>
</table-row>
</table-body>
Figure15-21:
Outputforcell
spanningtworows
row 1 1 column 1
row 1 1 column 2
row 2 2 column 2
15.8 Cellseparation
XSL-FOhastwowaysofprocessingthebordersofadjacentcellsdependingonthevalue
oftheborder-collapseattributeonthetable.
Ifborder-collapse="collapse",whichisthedefault,thereisnogapbetweencellsandthe
bordersofadjacentcellsaremerged(or"collapsed")togetasinglebordersharedby
bothcells.TherulesforcombiningbordersareexplainedintheXSL-FOspecification.
Broadlyspeakingthe widestborderwill beused. Thisiscalledthe collapsedborder
model.
Ifborder-collapse="separate"adjacentbordersarenotmerged.Agapcanbeinserted
between adjacent borders using g the border-spacing g attribute. . The e border-spacing
attribute can have one e or two o values. If f one e value is specified (for instance
border-spacing="1mm")theverticalandhorizontalspacingbetweencellsissettothis
value. If two o values s are specified d separated d by y a space (for instance
border-spacing='1mm3mm')thehorizontalseparationissettothefirstvalueandthe
verticalseparationissettothesecond.Thisiscalledtheseparatedbordermodel.
Thefollowingexamplesuseatablewithonerowcontainingtwocells.Thefirstcellhasa
bottomborder,theseconddoesnot.Thetablealsohasabottomborder.
Intheseparatebordermodeltheborderfromthefirstcellwillbedrawnbeforethe
borderofthetableasshowninFigure15-22.
C# PDF Convert to Word SDK: Convert PDF to Word library in C#.net
Powerful components for batch converting PDF documents in C# of the original PDF page size. DocumentType targetType, ImageCompress compression, String filePath).
change font size pdf document; pdf form change font size
C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF
Professional .NET PDF converter control for batch conversion. Description: Convert to PDF/TIFF with specified compression method and save it on the disk.
change font size pdf form; change font size pdf text box
IbexPDFCreator
DevelopersGuide
88
Tables
Figure15-22:
Cellswithseparate
borders
this cell has
a bottom
border
this cell does
not have a bottom
border
Inthecollapsedbordermodeltheborderfromthefirstcellwillbemergedwiththe
borderofthetableandasingleborderwillbedrawnasshowninFigure15-23.
Figure15-23:
Cellbordercollapsed
withtableborder
this cell has
a bottom
border
this cell does
not have a bottom
border
Ifweaddaninnerbordertoeachcellwecanseethiswiththeseparatemodel,asshown
inFigure15-24.
Figure15-24:
Separatecelland
tableborders
this cell has
a bottom
border
this cell does
not have a
bottom border
Withthecollapsedbordermodeltheborderbetweenthetwocellswillbehalfthewidth
itisintheseparatemodel,asshowninFigure15-25.
Figure15-25:
Collapsedborders
this cell has
a bottom
border
this cell does
not have a bottom
border
Figure 15-26 6 shows an example of a a table e with h separate e borders. . Note e how the
border-spacingontheprevioustablesetsthespacebetweencellsonly,notthespace
betweenthecellandthetableborder.Thisspacecanbesetusingpadding.Ifweadd
padding="2mm"tothetablewegetthelayoutshowninFigure15-27.
Figure15-26:
Tablewithseparate
borders
cell one
cell two
cell three
cell four
Figure15-27:
Cellsseparatedfrom
thetablebordersby
padding
cell one
cell two
cell three
cell four
15.9 Tableheaders
Table headers are created using g the table-header element. . The table-header should
appear inside the table element after any table-column elements and before e any
table-bodyelements.The table-headerelementissimilarinstructuretoatable-body
elementinthatitcontainstable-rowelements.
C# Create PDF from Excel Library to convert xlsx, xls to PDF in C#
Professional .NET PDF converter control for batch conversion. Description: Convert to PDF/TIFF with specified compression method and save it on the disk.
best pdf compressor; pdf page size dimensions
C# Create PDF from Word Library to convert docx, doc to PDF in C#.
Professional .NET control for batch conversion in C#.NET class. Description: Convert to PDF/TIFF with specified compression method and save it on the disk.
pdf page size limit; pdf compress
IbexPDFCreator
DevelopersGuide
Tables
89
Thissectiondescribesthe behavior oftable headers whichdo notchange. Headers
whichcanhavedifferentcontentondifferentpagesaredescribedlaterinthischapterin
thesectiononcontinuationmarkersonpage91.
Figure15-28showstheFOforasimpletablewithaonerowheaderandtwocontent
rows.TheoutputcreatedbytheFOappearsinFigure15-29.
Figure15-28:
Simpletablewith
header
<table>
<table-column column-width="100%"/>
<table-header>
<table-row>
<table-cell border="1pt t solid d black" padding="5pt">
<block>Heading</block>
</table-cell>
</table-row>
</table-header>
<table-body>
<table-row>
<table-cell border="1pt t solid d black" padding="5pt">
<block>row 1</block>
</table-cell>
</table-row>
<table-row border="1pt t solid black" " padding="5pt">
<table-cell>
<block>row 2</block>
</table-cell>
</table-row>
</table-body>
</table>
Figure15-29:
Tablewithsimple
header
Heading
row 1
row 2
Tableheadersarerepeatedatthetopofthetableaftereachpagebreak.Thisisthe
default. To o prevent the table header r appearing on n pages s after r the first, specify
table-omit-header-at-break="true"onthetableelement.
15.10 Tablefooters
Tablefootersarecreatedusingthetable-footerelement.Thetable-footershouldappear
insidethetableelementafteranytable-columnandtable-headerelementsandbefore
anytable-bodyelements.Thetable-footerelementissimilarinstructuretoatable-body
elementinthatitcontainstable-rowelements.
Itisacommonerrortoplacethetable-footerelementattheendofthetable,afterthe
table-bodyelements.Itmustbeplacedbeforethetable-bodyelementsbecauseIbex
maystartrenderingthetabletoPDFbeforethewholetablehasbeenreadfromtheFO
file.
Thissectiondescribesthebehavioroftablefooterswhichdonotchange.Footerswhich
canhavedifferentcontentondifferentpagesaredescribedlaterinthischapterinthe
sectiononcontinuationmarkersonpage91.
JPEG2000 to PDF Converter | Convert JPEG2000 to PDF, Convert PDF
Alongside image conversion and compression capabilities, this JPEG2000 to PDF Converter also to manipulate converted files, even in batch conversion mode.
change page size of pdf document; pdf change font size
C# Create PDF from CSV to convert csv files to PDF in C#.net, ASP.
NET library for batch converting CSV formats to adobe PDF files in Visual C#. Description: Convert to PDF/TIFF with specified compression method and save
reader shrink pdf; pdf compression settings
IbexPDFCreator
DevelopersGuide
90
Tables
Figure15-30showstheFOforasimpletablewithaonerowheaderandfooterandtwo
contentrows.TheoutputcreatedbytheFOappearsinFigure15-31.
Figure15-30:
FOforsimpletable
withheaderand
footer
<table>
<table-column column-width="100%"/>
<table-header>
<table-row>
<table-cell border="1pt t solid d black" padding="5pt">
<block>Heading</block>
</table-cell>
</table-row>
</table-header>
<table-footer>
<table-row>
<table-cell border="1pt t solid d black" padding="5pt">
<block>Footer</block>
</table-cell>
</table-row>
</table-footer>
<table-body>
<table-row>
<table-cell border="1pt t solid d black" padding="5pt">
<block>row 1</block>
</table-cell>
</table-row>
<table-row border="1pt t solid black" " padding="5pt">
<table-cell>
<block>row 2</block>
</table-cell>
</table-row>
</table-body>
</table>
Figure15-31:
Tablewithsimple
headerandfooter
Heading
row 1
row 2
Footer
Tablefootersarerepeatedatthebottomofthetablebeforeeachpagebreak.Thisisthe
default. Topreventthe tablefooter appearingonpagesotherthanthe last,specify
table-omit-footer-at-break="true"onthetableelement.
15.11 Behavioratpagebreaks
15.11.1 Repeatingheaders
Tableheadersarerepeatedatthetopofthetableaftereachpagebreak.Thisisthe
default. To o prevent the table header r appearing on n pages s after r the first, specify
table-omit-header-at-break="true"onthetableelement.
C# Create PDF from OpenOffice to convert odt, odp files to PDF in
A professional .NET PDF control able to batch convert multiple OpenOffice documents Description: Convert to PDF/TIFF with specified compression method and
change font size in fillable pdf form; change font size pdf comment box
JPEG2000 to JBIG2 Converter | Convert JPEG2000 to JBIG2, Convert
image compression capabilities (lossy compression & lossless compression) are also to, from JBIG2 image with single-page conversion or batch conversion method;
adjust pdf page size; compress pdf
IbexPDFCreator
DevelopersGuide
Tables
91
15.11.2 Repeatingfooters
Tablefootersarerepeatedatthebottomofthetablebeforeeachpagebreak.Thisisthe
default. Topreventthe tablefooter appearingonpagesotherthanthe last,specify
table-omit-footer-at-break="true"onthetableelement.
15.11.3 Repeatingtableborders
Tablebordersbydefaultdonotrepeatatabreakinthetable,sothetopborderofa
table is s rendered only on the e first t page the e table e is onand the bottom m border is
renderedonlyonthelastpage.
Tomakethetablebottomborderrepeatateachpagebreakitisnecessarytospecify
border-after-width.conditionality="retain"onthetableelement.
To make the table topborderrepeat at each page break it is necessarytospecify
border-before-width.conditionality="retain"onthetableelement.
15.12 Tablecontinuationmarkers
Table continuation n markers provide e a way y of dynamically changing the e header and
footeronatablesothatdifferentcontentcanbedisplayedondifferentpages.Atypical
useofthisfeatureistoputthewords"continuedonnextpage"inthefooterofatable
onallpagesexceptthelast.
Hereweexaminehowthe"continuedonnextpage"requirementcanbesatisfiedusing
Ibex.TheapproachtakenbyXSL-FOhastwoparts,implementedusingthemarkerand
retrieve-table-marker elements. Firsta retrieve-table-marker elementis added tothe
footer.WhenthePDFiscreatedthiselementwillbereplacedbythecontentsofoneof
the marker elements which h has s the e same class name. The marker element which
appears in n the footer r depends on n the e values s of the attributes on the
retrieve-table-marker.
Thefooter forthisexample isshowninFigure15-32. As the PDFfile iscreatedthe
contentsofthemarkerelementwithmarker-class-name="continued"willbelocated
andinsertedintothetable-footerelement.Thecontentofthemarkerelementmustbe
validFO elements fortheir location in thetable-footer. Inthis s exampletheretrieved
elementsgodirectlyunderthetable-footerelement,sotheelementsretrievedmustbe
table-rowelements.
Figure15-32:
FOfor
retrieve-table-marker
<table-footer>
<retrieve-table-marker
retrieve-class-name="continued"
retrieve-position-within-table="first-starting"
retrieve-boundary-within-table="page"/>
</table-footer>
Typically,therewillbemorethanonemarkerelementwhichhasthemarker-class-name
="continued".Ifthisisnotthe case thenthefootercontentwillneverchange. The
retrieve-positionattributespecifieswhichmarkertoretrieve.Inthisexamplewewant
the first t marker r which h appears s on n the e page, , so we use retrieve-position =
IbexPDFCreator
DevelopersGuide
92
Tables
"first-starting-within-page".Wealsospecifyretrieve-boundary="table"soanymarker
fromanypartofthetablewhichhasbeenoutputtoPDFcanberetrieved.Otheroptions
aredetailedlaterinthissection.
Conceptually,IbexlooksateveryrowinthetablewhichhasbeenoutputtothePDFfile
(includingrowsonthecurrentpage),collectsallthemarkersassociatedwitheachof
thoserowsandselectsonetogointothefooter.Markersassociatedwithrowswhich
arenotoneitherthecurrentpageorpriorpagesarenotconsidered.Itispossibleto
have a different marker r associated with every y row w in the e table. . This is s useful for
situationssuchaslikerenderingarunningtotal.
Thesecondpartoftheprocessistodefineoneormoremarkerelements.Inthiscase
ourmarkerelementsareassociatedwithtable-rowelements.Thefirsttable-rowhasa
markerelementwhichspecifiesthe"continuedonnextpage"text.Thecontentsofthis
markerwillberetrievedforallpagesexceptthelast.
Thelastrowofthetablehasanemptymarkerelement.Thecontentofthis(thatisto
saynorows)willbewhatappearsinthefooteronthelastpageofthetable.Themarker
fromthefirstrowisshowninFigure15-33andthemarkerfromthelastrowisshownin
Figure15-34.
Figure15-33:
FOformarkerinthe
firsttablerow
<table-row>
<marker marker-class-name="continued">
<table-row>
<table-cell>
<block>continued on next page/<block>
</table-cell>
</table-row>
</marker>
<table-cell>
<block>row 1 1 cell 1 /<block>
</table-cell>
</table-row>
Figure15-34:
FOformarkerinthe
lasttablerow
<table-row>
<marker marker-class-name="continued"/>
<table-cell>
<block>row (last) ) cell 1 /<block>
</table-cell>
<table-row>
15.13 Aligningcolumnsatthedecimalpoint
Ibex can alignthecontents ofcellsin acolumnonthe decimal point byspecifying
text-align="."oneachfo:table-cellinthecolumn. Thiscanbedoneexplicityoneach
fo:table-cell, or r to o make things easier to maintain n it t can be done e by y specifying
text-align="." on the fo:table-column and d text-align="from-table-column" " on each
fo:table-cell.
ExampleFOforaligningcolumnsisshowninFigure15-35andtheresultingoutputis
showninFigure15-36.
IbexPDFCreator
DevelopersGuide
Tables
93
Figure15-35:
FOfordecimalpoint
alignment
<table font="10pt t arial">
<table-column column-width="50%" />
<table-column column-width="50%" text-align="."/>
<table-body>
<table-row>
<table-cell border="1pt t solid black" " padding="3pt" " >
<block>ibexdls</block>
</table-cell>
<table-cell border="1pt t solid black" " padding="3pt"
text-align="from-table-column()">
<block>499.02</block>
</table-cell>
</table-row>
<table-row>
<table-cell border="1pt t solid black" " padding="3pt" " >
<block>Total</block>
</table-cell>
<table-cell border="1pt t solid black" " padding="3pt"
text-align="from-table-column()" font-size="18pt">
<block>499.00</block>
</table-cell>
</table-row>
</table-body>
</table>
Figure15-36:
Outputfordecimal
pointalignment
ibexdls
499.02
Total
499.00
94
Tables
Documents you may be interested
Documents you may be interested