IbexPDFCreator
DevelopersGuide
Colors
75
printed page, , or evenontwodifferent computerscreens. CMYK colorsare usedto
ensurethatcolorsarethesameonscreenandontheprintedpage.
PDFfilesareusuallycreatedwithsinglecolorscheme.YouwouldnotusuallymixCMYK
andRGBcolorsinonedocument.NotethatwhencreatingaCMYKPDFfileanyimages
includedinthedocumentshouldbeinCMYKformat.
ACMYKcolorisdefinedusingthergb-icc()function.Thistakeseightparameters.The
firstthreedefinethered,greenandbluecomponentsofafallbackRGBcolor,thefourth
definesthecolorprofilename,andthelastfourdefinethefourpartsoftheCMYKcolor.
Thecolorprofilemusthavebeendeclaredinthedeclarationsformattingobjectusinga
color-profileelement.
Figure13-5showsanexampleofthergb-icc()function.
Figure13-5:
Thergb-iccfunction
<block color="rgb-icc( ( 0, , 0, 0, cmyk, , 0.7,0.3,0.3,0.4 4 )">
in cmyk .5,.5,.5,0
</block>
InFigure13-5thethreecomponentsofthefallbackRGBcolorarezero.Thisisnormal
becausewearecreatingaCMYKPDFfileandwillnotbeusinganyfallbackRGBcolors.
Thecolorprofilenameis"cmyk".Ibexrequiresthatthecolorprofilenamebe"cmyk"
whencreatingaCMYKcolor.
AcompletedocumentusingtheCMYKcolorspaceisshowninFigure13-6.Thisshows
howtousethedeclarationsandcolor-profileelementstodefineacolorprofile.
Figure13-6:
FOforaCMYKPDF
file
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://www.w3.org/1999/XSL/Format">
<layout-master-set>
<simple-page-master master-name="page">
<region-body margin="1in"
region-name="body"/>
</simple-page-master>
</layout-master-set>
<declarations>
<color-profile src="src"
color-profile-name="cmyk"/>
</declarations>
<page-sequence master-reference="page">
<flow flow-name="body">
<block color="rgb-icc( 0, , 0, , 0, cmyk, 0.7,0.3,0.3,0.4 )">
in cmyk .5,.5,.5,0
</block>
</flow>
</page-sequence>
</root>
13.3.4 PDF/Xcolorprofiles
IbexcancreatePDFfileswhichconformtothePDF/Xstandard.Thesefilescaninclude
embedded color profiles, used to o define a common n color scheme across different
devices.
ColorprofilesareloadedfromfilesondiskandincludedinthePDFfile.Somecolor
profilesareverylarge(i.e.>500k)andcanresultinlargePDFfiles.
Pdf page size - Compress reduce PDF size in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
C# Code & .NET API to Compress & Decompress PDF Document
adjust size of pdf; pdf change font size in textbox
Pdf page size - 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
batch reduce pdf file size; change paper size in pdf
IbexPDFCreator
DevelopersGuide
76
Colors
LoadingacolorprofilefromafileondiskisanIbexextension.Thenameofthecolor
profile file is specified using the color-profile-file-name attribute of f the e ibex:pdfx
element,asshowninFigure13-7below.
Figure13-7:
FOforaPDF/X
showingtheloading
ofacolorprofile
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://www.w3.org/1999/XSL/Format"
xmlns:ibex="http://www.xmlpdf.com/2003/ibex/Format">
<layout-master-set>
<simple-page-master master-name="page" page-width="20cm">
<region-body region-name="body" margin="3cm" " reference-orientation='0'/>
</simple-page-master>
</layout-master-set>
<ibex:pdfx color-profile-file-name="colorprofiles\USWebCoatedSWOP.icc"
output-condition="TR001 SWOP/CGATS"/>
<page-sequence master-reference="page">
<flow flow-name="body">
<block font="10pt arial">
hello world
</block>
</flow>
</page-sequence>
</root>
C# PDF File Split Library: Split, seperate PDF into multiple files
Divide PDF file into multiple files by outputting PDF file size. control, C# developers can easily and accurately disassemble multi-page PDF document into two
batch pdf compression; change file size of pdf document
C# PDF Thumbnail Create SDK: Draw thumbnail images for PDF in C#.
public override Bitmap ConvertToImage(Size targetSize). Description: Convert the PDF page to bitmap with specified size. Parameters:
pdf reduce file size; change paper size in pdf document
Lists
77
Chapter14
Lists
Listsarecreatedusingthelist-blockelement.Alist-blockinXSL-FOisanareaofcontent
dividedintotwocolumns.
A simple list-block is s shownin Figure 14-1. The e list created d by this s FO O is shown in
Figure14-2.
Figure14-1:
FOforalist
<list-block provisional-distance-between-starts=".5cm"
provisional-label-separation="0.1cm">
<list-item>
<list-item-label end-indent="label-end()">
<block font='8pt arial'>&#x25CF;</block>
</list-item-label>
<list-item-body start-indent="body-start()">
<block>
item one
</block>
</list-item-body>
</list-item>
<list-item>
<list-item-label end-indent="label-end()">
<block font='8pt arial'>&#x25CF;</block>
</list-item-label>
<list-item-body start-indent="body-start()">
<block>
item two
</block>
</list-item-body>
</list-item>
</list-block>
Figure14-2:
Alist
item one
item two
Featuresoflistsinclude:
• thelist-blockisablock-levelelementwhichcontainsthewholelist.
• the e provisional-distance-between-starts s attribute e on the list-block defines s the
distancebetweenthestartofthelabelandthestartofthebody.
• theprovisional-label-separationattributeonthelist-blockdefinesthesizeofthegap
between the e end of f the e label and the e start t ofthe e body. . This s gap is created by
reducingthesizeofthelabel.Forexample,ifprovisional-distance-between-startsis
5cmandtheprovisional-label-separationis1cm,thenthestartedgesofthelabeland
bodywillbe5cmapart,andthelabelwillbe4cm(5cm-1cm)wide.
VB.NET PDF File Split Library: Split, seperate PDF into multiple
Separate source PDF document file by defined page range in VB.NET class application. Divide PDF file into multiple files by outputting PDF file size.
change font size pdf fillable form; best pdf compression tool
VB.NET PDF Thumbnail Create SDK: Draw thumbnail images for PDF in
Program.RootPath + "\\" 1.pdf" Dim doc As PDFDocument = New PDFDocument(inputFilePath) Dim page As PDFPage = doc.GetPage(0) ' Define the size of the
adjust size of pdf file; change font size on pdf text box
IbexPDFCreator
DevelopersGuide
78
Lists
• eachiteminthelistiscontainedinalist-itemelement.
• each list-item must contain n both a list-item-label and a list-item-body. The
list-item-labelmustcomefirst.
• thelist-item-labelshouldhavetheend-indentattributesetto"label-end()".Thisisa
special functionwhich returnsa value derived from provisional-distance-between-
startsandprovisional-label-separation.
• thelist-item-bodyshouldhavethestart-indentattributesetto"body-start()".Thisisa
special functionwhich returnsa value derived from provisional-distance-between-
startsandprovisional-label-separation.
• boththelist-item-labelandlist-item-bodycontainoneormoreblock-levelelements,
soalist-item-label orlist-item-bodycancontainotherblock-levelelementssuchas
block,tableandlist-block.
14.1 Bulletedlists
TheexampleinFigure14-1alsoshowshowtoinsertaUnicodecharacterintotheFO,
usingthesyntax&#x25CF;.
Thistableshowssomecommonbullettypesforlists:
Unicode
Result
&#x2022;
&#x2023;
&#x25CF;
&#x25CB;
&#x25A0;
&#x25A1;
&#x25C6;
&#x25C7;
C# PDF Convert to Jpeg SDK: Convert PDF to JPEG images in C#.net
Using this C#.NET PDF to JPEG conversion library component toolkit, C# developers can easily and quickly convert a large-size multi-page PDF document to a
change page size pdf acrobat; best way to compress pdf files
C# PDF Convert to Tiff SDK: Convert PDF to tiff images in C#.net
zoomValue, The magnification of the original PDF page size. 0.1f
.pdf printing in thumbnail size; can a pdf file be compressed
IbexPDFCreator
DevelopersGuide
Lists
79
Notethatwhatisdisplayedinthedocumentdependsonwhetherthefontyouareusing
containsthespecifiedcharacter.Ifthefontdoesnotcontainthespecifiedcharacteryou
willseeawarningmessageliketheoneinFigure14-3.
Figure14-3:
Errormessageif
bulletnotinfont
warning:380 No glyph index found d for r code point t 2023 in n font ArialMT
C# PDF Convert to Word SDK: Convert PDF to Word library in C#.net
zoomValue, The magnification of the original PDF page size. 0.1f
pdf edit text size; advanced pdf compressor
C# Convert: PDF to Word: How to Convert Adobe PDF to Microsoft
Support fast Word and PDF conversion with original document page size remained. Microsoft Office Word 2003 (.doc) and 2007 (.docx) versions are available.
change pdf page size; compress pdf
80
Lists
Tables
81
Chapter15
Tables
AtableinXSL-FOisanareaofcontentdividedintorowsandcolumns.Atableiscreated
withthetableelement.
AFOforasimpletableisshowninFigure15-1andtheoutputitcreatesisshownin
Figure 15-2.Thisshowsthebasicstructure ofatableelementcontainingtable-body,
table-rowandtable-cellelements.
Figure15-1:
FOforasimple2x2
table
<table>
<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-2:
Thesimple2x2table row 1 1 column 1
row 1 column 2
row 2 2 column 1
row 2 column 2
Thepaddingandborderattributesarenotinheritedfromcontainingelements,soare
bestdefinedonthetable-cellelements.
15.1 Cellpadding
Paddingistheamountofspacethatappearsbetweentheinsideedgeoftheborderofa
cellandtheoutsideedgeofthecontentofthecell.Paddingisspecifiedbythepadding
attribute.Thedefaultamountofpaddingis'0pt'.Figure15-3showsatablewithtwo
cells. The first cell haspadding="1pt" andthe secondhaspadding="5pt". Paddingis
almostalwaysusedtoavoidhavingthecontenttooclosetothecellborders.
IbexPDFCreator
DevelopersGuide
82
Tables
Figure15-3:
FOshowingcellswith
differentpadding
this cell has padding g set t to '1pt' so
the text is s close e to the edges of the
cell
this cell has padding set t to o '5pt' so the
text is not so close e to o the edges of the
cell
Thepaddingattributesetspaddingforallfoursidesofthecell.Individualsidescanbe
setusingthepadding-left,padding-right,padding-topandpadding-bottomattributes.
Thepaddingattributealsosupportsashorthandformatwhere:
ifonevalueisspecified(padding="2pt")thesamevaluewillapplytoallfoursides;
iftwovaluesarespecified(padding="2pt3pt")thefirstvaluewillapplytothetop
andbottomedges,thesecondvaluetotheleftandrightedges;
ifthreevaluesarespecified(padding="2pt3pt1pt")thefirstvaluewillapplytothe
topedge,thesecondtotheleftandrightedges,andthethirdtobottomedge;
iffourvaluesarespecified(padding="2pt3pt1pt0pt")thesewillapplytotop,
right,bottomandleftedgesinthatorder.
15.2 Cellbackgroundcolor
Thebackgroundcolorofacellisspecifiedusingthebackground-colorattribute.This
supportsthesamepredefinedcolorsasCSSandtheuseofhexvaluessuchas"#33ffcc".
Thebackgroundcolorofthecellextendstotheinsideedgeoftheborder,whichmeans
thattheareaspecifiedbythepaddingattributeiscoloredbythebackgroundcolor.This
is shown inFigure 15-4where the second cell has the attribute background-color=
"#dddddd".
Figure15-4:
Cellwithbackground
colorset
this cell has padding set
to '1pt' ' so the text is
close to the e edges s of the
cell
this cell has padding set to '5pt' so o the
text is s not t so close to the e edges s of the
cell. The background color covers the
padding.
Ifyoudonotwantthebackgroundtoextendtotheedgeofthepadding,specifythe
background-colorattributeonthecontentsofthecell(i.e.theblockelements)rather
thanonthetable-cell.AnexampleFOforthisisshowninFigure15-5andtheresulting
outputappearsinFigure15-6.
IbexPDFCreator
DevelopersGuide
Tables
83
Figure15-5:
FOsettingthe
backgroundcoloron
ablock
<table>
<table-body>
<table-row>
<table-cell border='1pt t solid blue' padding='1pt'>
<block>
this cell has padding set t to o '1pt' so the text is close e to o the edges of
the cell
</block>
</table-cell>
<table-cell border='1pt t solid blue' padding='5pt'
background-color='#dddddd'>
<block background-color='#dddddd'>
this cell has padding set t to o '5pt' so the text is not so close to o the
edges of the e cell
</block>
</table-cell>
</table-row>
</table-body>
Figure15-6:
Cellwithbackground
colorontheblock
element
this cell has padding set to
'1pt' so the e text is s close to
the edges of f the e cell
this cell has padding g set t to '5pt'
so the e text is s not so o close e to the
edges of the cell
15.3 Cellbackgroundimages
Animagecanbeusedasthebackgroundtoacellbyspecifyingthebackground-image
element,asshowninFigure15-7.ThisproducestheoutputshowninFigure15-8.
Figure15-7:
FOforusinganimage
asacellbackground
<table>
<table-body>
<table-row>
<table-cell border='1pt t solid blue' padding='1pt'>
<block>
this cell has padding set t to o '1pt' so the text is close e to o the edges of
the cell
</block>
</table-cell>
<table-cell border='1pt t solid blue' padding='5pt'
background-image='url(ibex.jpg)'>
<block>
this cell has a a background d image
</block>
</table-cell>
</table-row>
</table-body>
Figure15-8:
Cellwithimage
background
this cell has padding set to '1pt' so o the
text is s close e to the edges of the cell
this cell has a background
image
Astheaboveexampleshows,bydefaulttheimagewillberepeatedifitislessthanthe
widthofthecell.Thiscanbechangedusingthebackground-repeatattribute.Ifthisis
setto"no-repeat"theoutputchangestothatshowninFigure15-9.
Figure15-9:
Using
background-repeat=
'no-repeat'
this cell has padding set to '1pt' so o the
text is s close e to the edges of the cell
this cell has a background
image
IbexPDFCreator
DevelopersGuide
84
Tables
The
background
image
can
be
positioned
in
the
cell using
the
background-position-horizontalandbackground-position-verticalattributes.Thecellin
Figure15-10examplehasbackground-position-horizontalsetto"50%".
Figure15-10:
Centeringthe
backgroundimage
this cell has padding set to "1pt: so o the
text is s close e to the edges of the cell
this cell has a background
image
15.4 Implicitandexplicitrows
UsuallyFOfilesusethetable-rowelementtodefinewhichcellsareinwhichrows,as
showninFigure15-11.
Figure15-11:
Tableswithcells
containedinrows
<table>
<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>
Itispossibletodispensewiththetable-rowelementandhavethetable-bodycontain
table-cellelementsdirectly.Inthiscaseanycellcanhavetheends-rowattributesetto
"true",whichcausesanewrowtobestartedcontainingthenextcell.Thisapproachis
sometimeseasiertousewhengeneratingtheFOusingXSLT.
Figure15-12showswhattheaboveFOwouldlooklikeifwechangedittouseimplicit
rows.TheoutputfromthisappearsinFigure15-13below.
Figure15-12:
FOforatablewith
implicitrows
<table>
<table-body>
<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'
ends-row='true'>
<block>row 1 1 column 2</block>
</table-cell>
<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-body>
Documents you may be interested
Documents you may be interested