Home

Ibex Programmers Guide

image

Contents

1. base OnInit e J private void InitializeComponent this Load new System EventHandler this Page_Load The changes made were e we declared a variable for the XSLT template like this string templateFilePath Server MapPath template xsl e we opened the XSLT template using a Stream FileStream xslStream new FileStream templateFilePath FileMode Open FileAccess Read e we passed the XSL stream to the generate method using dataStream using xslStream doc generate dataStream xslStream pdfStream false Using Ibex with ASP NET 37 38 Using Ibex with ASP NET Chapter 7 Error Handling amp Logging This chapter describes error handling using the Ibex API Ibex associates an error handler with the library as a whole Generally this error handler will log a message and not throw an exception The Ibex Logger object is a singleton which is retrieved using a call to the ibex4 logging Logger getLogger method Typically you would import the ibex4 logging namespace and then access the logger as shown in Figure 7 1 Figure 7 1 using ibex4 logging Clearing existing error handlers void sumfunc Fal Logger getLogger clearHandlers The default error handler writes messages to the console Messages are displayed in various circumstances including e when an invalid attribute is found e when a reference is made to a font or image file which cannot be
2. 25 1113 25 11 14 Figure 25 20 Ibex PDF Creator Developers Guide super Text is raised by an amount read from the font file percentage Text is raised or lowered by a percentage of the current font size length Text is raised or lowered by the specified amount blank or not blank Description This is used on a repeatable page master alternative to specify whether the page master should be selected when the current page is blank The current page will be blank if an extra page is being generated in a page sequence because it must have an odd or even number of pages or because the following page sequence must start on an odd or even page Default value any Values any blank not blank Text is raised by an amount read from the font file block progression dimension Description Sets the dimension of content in the block progression direction which for a non rotated page is down the page The content of an element excludes padding and borders This means an element with block progression dimension 3cm and border 25cm will have a height including borders and padding of 3 5cm Can be set as a single value such as block progression dimension 20cm or you can specify minimum and maximum values like this Elements and Attributes 295 Figure 25 21 25 115 Figure 25 22 Ibex PDF Creator Developers Guide block progression dimension minimum 5cm block progression dimension maximum 25cm De
3. text basic link zero or more bidi override zero or more character zero or more external graphic zero or more float one or more cannot be used inside an out of line element footnote one or more cannot be used inside an out of line element index page citation last zero or more index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element inline zero or more inline container zero or more instream foreign object zero or more leader zero or more page number zero or more page number citation zero or more page number citation last zero or more retrieve marker one or more subject to constraints specified for this element scaling value citation zero or more wrapper one or more subject to constraints specified for this element Parent element s This element can be contained in the following elements 274 index key reference Elements and Attributes 25 9 3 Ibex PDF Creator Developers Guide index range begin Description This element is used to indicate the start of a range of content which has an associated index key The index will typically contain the range of page numbers between an index range begin and an index range end An index range begin index range end pair match if the ref id property of the index range end has the same value as the id property on the index range beg
4. Default value This attribute has no default value you must provide a value 326 Elements and Attributes 20 11 55 25 11 56 25 11 57 Ibex PDF Creator clear Description Developers Guide This is used on an element to specify that it may not be placed next to a float element on one or both sides Default value none Values left right both none inherit clip Description Not used in PDF creation Default value auto color Description This sets the foreground color of text Default value inherited from parent Values lt color gt Elements and Attributes A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color 327 25 11 58 25 11 59 Figure 25 68 25 11 60 Ibex PDF Creator Developers Guide color profile name Description This is used in specifying color profiles for PDF X documents The value must be set to cmyk See page 143 for more information Default value auto column count Description Sets the number of columns in a body region Only the body region can have more than one column For example to create a body region with three columns set column count to 3 like this lt xml version 1 0 encoding UTF 8 gt lt root xmlns fo http www w3 org 1999 XSL Format gt lt layout master set gt lt simple page master master name simple gt lt region body margin 2 5cm region
5. Figure 25 26 border before color red Default value the value of the color property Developers Guide Values lt color gt A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color inherit 25 11 20 border before style Description Sets the before border style which for a non rotated object is the top one For example Figure 25 27 border before style solid Default value none Values lt border style gt Can be any of the values none No border solid A single solid line this is 1pt solid black double Two lines separated by a gap The gap is 1 3 of the width of the border this is 4pt black double dashed See example this is 2pt black dashed z kannn eee a dotted See example F this is 2pt black dotted inset The top and left borders are slightly darker then 300 Elements and Attributes the required color and the bottom and right borders are slightly lighter this is 2pt blue inset 20 11 21 Figure 25 28 Ibex PDF Creator inherit border before width Description outset groove ridge Developers Guide See example this is 2pt blue outset See example See example Sets the before border width which for a non rotated object is the top one For example border before width 1pt Default value medium Values lt border width gt inherit Can be any of the values thin medium thick
6. Within a table body or table header and table footer element a table has table cell elements Normally cells are placed inside a table row element but it is possible to place the cells directly below the table body element and not have any table row elements In this case the formatter determines formation of rows by looking for ends row and 332 Elements and Attributes Figure 25 72 25 11 68 Ibex PDF Creator Developers Guide starts row attributes on each table cell If a table cell ends the row then the ends row attribute should be set to true otherwise it should be set to false or not used at all A table which has two rows of three cells each and is created without row elements looks like this lt table gt lt table body gt lt table cell starts row true gt col 1 lt table cell gt lt table cell gt col 2 lt table cell gt lt table cell ends row true gt col 3 lt table cell gt lt table cell starts row true gt col 1 lt table cell gt lt table cell gt col 2 lt table cell gt lt table cell ends row true gt col 3 lt table cell gt lt table body gt lt table gt Default value false Values false This cell does not end the row true This cell ends the row extent Description The extent attribute determines how large a region is It is used on region elements other then the region body element The extent is the size of the region The outer edge of the region is calculated from the edge of
7. hello pdf A PDF file can be created from FO contained in Stream to a PDF Stream using this call ibex GenerateXMLStreamPDFStream strmInput strmPDF True The final parameter True in this case indicates the output stream should be closed after the PDF file is created The input Stream object is part of the ADO 2 5 namespace which is why we added a reference to ADO 2 5 earlier on A stream can be populated from a file on disk using code like this strmInput Open must match encoding of fo file or will get invalid data at 1 1 message strmInput Charset utf 8 strmInput LoadFromFile hello fo strmInput Position 0 To create a PDF file using XSLT translation use this call with the XML and XSL read from Stream objects and the PDF written to a Stream ibex GenerateXMLStreamXSLStreamPDFStream strmXML strmXSL strmPDF True 150 Using Ibex with Visual Basic and ASP Chapter 25 Elements and Attributes This chapter describes each major formatting object and its usage 25 1 Declarations and pagination and layout formatting objects The objects described in this section are used to define the geometry of the page and to control which content appears where on the page Elements and Attributes 151 Ibex PDF Creator 25 1 1 root Description Developers Guide This is the top level element in the FO and contains the layout master set an optional declarations and one or more page sequence elements These child elem
8. lt block gt lt flow gt lt page sequence gt lt root gt Default value a unique value generated by Ibex Values lt id gt a unique string 25 11 82 initial page number Description This attribute sets the page number of the first page create by a page sequence element Default value auto 25 11 83 inline progression dimension Description Sets the dimension of content in the inline progression direction which for a non rotated page is across the page The content of an element excludes padding and borders This means an element with inline progression dimension 3cm and border 25cm will have a width including borders and padding of 3 5cm 342 Elements and Attributes Figure 25 90 Figure 25 91 25 11 84 25 1 180 Ibex PDF Creator Developers Guide Can be set as a single value such as inline progression dimension 20cm or you can specify minimum and maximum values like this inline progression dimension minimum 5cm inline progression dimension maximum 25cm Default value auto Values auto lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points lt length range gt The value has three sub components namely minimim optimum and maximum Each of these can be set to a lt length gt value inherit internal destination Description This sets the destination of a basic link el
9. lt layout master set gt lt page sequence wrapper index key main gt lt page sequence master reference simple gt lt flow flow name body gt lt block gt Hello World lt block gt lt flow gt lt page sequence gt lt page sequence wrapper gt lt root gt Elements and Attributes 157 25 1 6 Ibex PDF Creator Developers Guide layout master set Description This element contains all the page master elements simple page master page sequence master used to create individual pages or sequence of pages At least one child element must exist or the document will contain no pages Child element s This element can contain the following elements flow map zero or more page sequence master zero or more simple page master zero or more Parent element s This element can be contained in the following elements root For an example showing the use of the element see Figure 25 1 158 Elements and Attributes ise ed Ibex PDF Creator Developers Guide page sequence master Description This element is used to define the sequence in which one or more page master elements simple page master repeatable page master are used to create pages The element describes a sequence of page layouts and has a master name which uniquely identifies it This master rname is used as the master reference on a page sequence element in order to create pages using the sequence described by this page sequence master
10. lt length gt A thin border The actual default width is Settings BorderWidthThin and so can be changed programatically A medium border The actual default width is Settings BorderWidthMedium and so can be changed programatically A thick border The actual default width is Settings BorderWidthThick and so can be changed programatically A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points Elements and Attributes 301 25 11 22 Figure 25 29 Ibex PDF Creator Developers Guide border bottom Description Sets the color width and style of the bottom border of an element A shorthand way of setting border bottom color border bottom width and border bottom style Any of the values listed can be combined for example you can have border bottom 12pt solid red Default value Shorthand properties do not have default values See individual properties for their default values Values lt color gt A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color lt border width gt Can be any of the values thin A thin border The actual default width is Settings BorderWidthThin and so can be changed programatically medium A medium border The actual default width is Settings BorderWidthMedium and so can be changed programatically thick A thick border The actual default width is Set
11. lt page sequence master reference repeated gt lt flow flow name body gt lt block gt Hello World lt block gt lt flow gt lt page sequence gt lt root gt 160 Elements and Attributes Developers Guide 25 1 8 Ibex PDF Creator Developers Guide single page master reference Description This element specifies that the simple page master which has a master name corresponding to the master reference of this element should be used to define the layout for a single page Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements page sequence master Attributes The following attributes can be used on this element master reference For an example showing the use of the element see Figure 25 1 Elements and Attributes 161 25 1 9 Ibex PDF Creator Developers Guide repeatable page master reference Description This element specifies that the simple page master which has a master name corresponding to the master reference of this element should be used to define the layout of one or more pages The difference between this and a single page master reference is that the single page master reference produces one page whereas this element can produce multiple pages The maximum number of pages created by this element is controlled by the maximum repeats attribute which by default is unlimited Chi
12. white space collapse Description This controls how multiple contiguous whitespace in the FO is treated by Ibex By default after processing of linefeeds all remaining runs of two or more consecutive spaces are replaced by a single space then any remaining space immediately adjacent to a remaining linefeed is also discarded See page 69 for a detailed example of the effects of this attribute Elements and Attributes 369 25 11 142 25 11 143 25 11 144 Ibex PDF Creator Developers Guide Default value true white space treatment Description This controls how whitespace characters in the FO are treated by Ibex See page 69 for a detailed example of the effects of this attribute Default value ignore if surrounding linefeed widows Description This specifies the number of lines of text which must appear in a paragraph at the top of a page At the default setting of 2 a single line will never appear by itself at the top of a page If possible a line from the previous page will be moved to the the current page so that 2 lines of text appear at the top of the page If this is not possible perhaps because of the orphans setting the whole paragraph will be moved to the current page Increasing the value increases the number of lines which must appear on a page See also orphans Default value width Description This sets the desired width for an element This is shorthand way of setting all three component
13. Parent element s This element can be contained in the following elements simple page master Attributes The following attributes can be used on this element background attachment background color background image background repeat background position horizontal background position vertical border border before color border before style border before width border after color border after style border after width border start color border start style border start width border end color border end style border end width border top 170 Elements and Attributes Ibex PDF Creator border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left clip extent precedence reference orientation Developers Guide border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right display align overflow region name writing mode For an example showing the use of the element see Figure 25 5 Elements and Attributes 171 25 1 16 Ibex PDF Creator Developers Guide region start Description This element defines the shape of a region which is at the left of a non rotated page Content from static content elements whose flow name matches the region name will be
14. When the first page of the chapter is being created the page position first condition is true so the first conditional page master reference will be chosen because it has page position first This has master reference chapter odd no header so the simple page master with master name chapter odd no header becomes the active page master for the first page of the chapter When the second page of the chapter is being created the page position first is no longer true so the conditions on the next conditional page master reference will be evaluated Although not shown in this example other attributes such as blank or not blank can be used to control the selection of one of the alternatives lt page sequence master master name chapter gt lt repeatable page master alternatives gt lt conditional page master reference page position first master reference Cchapter odd no header gt lt conditional page master reference odd or even o0dd master reference chapter odd gt lt conditional page master reference odd or even even master reference chapter even gt lt repeatable page master alternatives gt lt page sequence master gt Page Layout 47 48 Page Layout region before region body This page layout is created with the XML below Note that by default the region start and region end regions extend the full height of the page and the region before and region after regions are narrowed so
15. folio prefix bidi override marker Elements and Attributes 215 25 3 9 Ibex PDF Creator Developers Guide page number Description This element is used to insert the current page number into the document The page number string is formatted using the string conversion properties of the containing page sequence namely format grouping separator grouping size letter value country and language Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title block inline folio suffix folio prefix bidi override marker Attributes The following attributes can be used on this element background attachment background color background image background repeat background position horizontal background position vertical border border before color 216 Elements and Attributes Ibex PDF Creator border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left font family font size font size adjust font v
16. from the result of the translation 8 Getting Started with Ibex Ibex PDF Creator Developers Guide We have some weather forecast data in the file weather xml This file contains the XML shown in Figure 3 2 Figure 3 2 lt xml version 1 0 encoding UTF 8 gt Weather Forecast lt forecast gt Data lt city name Wellington temp 20 gt lt forecast gt We also have an XSLT stylesheet weather xsl which contains the XSL shown in Figure 3 3 Figure 3 3 on version 1 0 encoding utf 8 gt Weather Forecast lt xs1 stylesheet version 1 0 Stylesheet xmlns xsl http www w3 org 1999 XSL Transform xmlns fo http www w3 org 1999 XSL Format xmlns ibex http www xmlpdf com 2003 ibex Format gt lt xsl strip space elements gt lt xsl template match forecast gt lt root xmlns http www w3 org 1999 XSL Format gt lt layout master set gt lt simple page master master name page layout gt lt region body margin 2 5cm region name body gt lt simple page master gt lt layout master set gt lt page sequence master reference page layout gt lt flow flow name body gt lt xsl apply templates select city gt lt flow gt lt page sequence gt lt root gt lt xsl template gt lt xsl template match city gt lt fo block gt lt xsl value of select name gt lt xsl value of select temp gt lt fo block gt lt xsl template gt lt xsl stylesheet gt T
17. medium A medium border The actual default width is Settings BorderWidthMedium and so can be changed programatically thick A thick border The actual default width is Settings BorderWidthThick and so can be changed programatically lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit border right Description Sets the color width and style of the right border of an element A shorthand way of setting border right color border right width and border right style Any of the values listed can be combined for example you can have border right 12pt solid red Default value Shorthand properties do not have default values See individual properties for their default values Values lt color gt A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color lt border width gt Can be any of the values thin A thin border The actual default width is Settings BorderWidthThin and so can be changed programatically medium A medium border The actual default width is 312 Elements and Attributes Settings BorderWidthMedium and so can be changed programatically Ibex PDF Creator Developers Guide thick A thick border The actual default width is Settings BorderWidthThick and so can be changed programatically lt length gt A length such as 10cm Valid units are pt
18. points cm centimetres in inches mm millimetres em current font size in points lt border style gt Can be any of the values none No border solid A single solid line this is 1pt solid black double Two lines separated by a gap The gap is 1 3 of the width of the border this is 4pt black double dashed See example i this is 2pt black dashed gt kannn ee a dotted See example F this is 2pt black dotted inset The top and left borders are slightly darker then the required color and the bottom and right borders are slightly lighter this is 2pt blue inset outset See example this is 2pt blue outset groove See example ridge See example inherit 25 11 36 border right color Description Sets the right border color For example Figure 25 45 border right color red Default value the value of the color property Elements and Attributes 313 25 11 37 Figure 25 46 Ibex PDF Creator Developers Guide Values lt color gt A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color inherit border right style Description Sets the right border style For example border right style solid Default value none Values lt border style gt Can be any of the values none No border solid A single solid line this is 1pt solid black double Two lines separated by a gap The gap is 1 3 of the width of the border
19. which is assumed to be the left hand edge of odd numbered pages and the right hand edge of even numbered pages The effect of some of the text align values is shown in Figure 9 9 Figure 9 9 Effects of text align values This paragraph has no text align attribute so by default is aligned to the left so that the words form a smooth line against the left margin and a ragged edge on the PLEINE This paragraph has text align right and so is aligned to the right so that the words form a smooth line against the right margin and have a ragged edge on the left This paragraph has text align justify so that the words form a smooth line against both the left and right margins except for the last line which is aligned independently using the text align last attribute This paragraph has text align center so that the words are centered in the middle of the block 9 8 1 Justifying the last line of a paragraph Specifying text align justify will justify all lines of a paragraph except the last This is because a justified paragraph typically looks like the one in Figure 9 10 with the last line not being justified 56 Text Formatting Ibex PDF Creator Figure 9 10 Paragraph without Lorem ipsum dolor sit amet consectetuer adipiscing elit i Sten a vehicula aliquam auctor metus turpis tempus justo eu gravida nisl nibh vitae nisl the last line justified cras a nisl Integer et metus vitae dui placerat ege
20. Attributes Developers Guide background repeat background position vertical border before color border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right margin top margin right space before start indent relative position top left break before clear index class intrusion displace keep with next text align 25 4 2 Ibex PDF Creator Developers Guide table Description This element creates a table Tables have rows and columns and possibly also headers and footers The size of table columns can either be calculated from the content of cells or specified using table column elements Using table column elements results in consistent output regardless of cell contents The width and other characteristics of columns are defined using table column elements An optional table header which by default is repeated after each page break is specified using the table header element An optional table footer which by default is repeated before each page break is specified using the table footer element Table rows are contained in one or more table body elements Table borders are controlled using the border collapse attribute If this has a value of collapse then table and cell borders are co
21. CMs oS 595 65 0 lt block gt lt flow gt lt page sequence gt a COOL gt 13 3 4 PDF X color profiles Ibex can create PDF files which conform to the PDF X standard These files can include embedded color profiles used to define a common color scheme across different devices Color profiles are loaded from files on disk and included in the PDF file Some color profiles are very large i e gt 500k and can result in large PDF files Colors 75 Ibex PDF Creator Developers Guide Loading a color profile from a file on disk is an Ibex extension The name of the color profile file is specified using the color profile file name attribute of the ibex pdfx element as shown in Figure 13 7 below BPE TS o i version 1 0 encoding UTF 8 gt FO for a PDF X lt root xmins http www w3 org 1999 XSL Format showing the loading xmlns ibex http www xmlpdf com 2003 ibex Format gt lt layout master set gt lt simple page master master name page page width 20cm gt lt region body region name body margin 3cm reference orientation 0 gt lt simple page master gt lt layout master set gt of a color profile lt ibex pdfx color profile file name colorprofiles USWebCoatedSWOP icc output condition TROO1L SWOP CGATS gt lt page sequence master reference page gt lt flow flow name body gt lt block font 10pt arial gt hello world lt block gt lt flow gt lt page sequence gt lt
22. Elements and Attributes Ibex PDF Creator Developers Guide 25 11 Attributes 25 11 1 absolute position Default value auto Values auto absolute fixed inherit 25 11 2 alignment adjust Description This is used on a formatting objects to help explicitly determine the baseline for objects such as images which do not have a baseline Default value auto 25 11 3 alignment baseline Description This is used to specify which baseline an object should be aligned on See page 61 for a discussion of baselines Default value auto Values inherit auto baseline Elements and Attributes 291 25 11 4 25 010 25 115 Ibex PDF Creator before edge text before edge central middle after edge text after edge ideographic alphabetic hanging mathematical allowed height scale Description Sets possible scaling values for images Not used in PDF creation Default value any allowed width scale Description Sets possible scaling values for images Not used in PDF creation Default value any background attachment Description Developers Guide Specifies whether background images scroll nor not Not used in PDF creation Default value any 292 Elements and Attributes 20 117 2 11 8 25 11 9 Ibex PDF Creator Developers Guide background color Description Sets the background color for the element Default value transparent Values lt color gt A colo
23. Figure 25 60 Ibex PDF Creator lt border style gt inherit border top color Description medium thick lt length gt Developers Guide A medium border The actual default width is Settings BorderWidthMedium and so can be changed programatically A thick border The actual default width is Settings BorderWidthThick and so can be changed programatically A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points Can be any of the values none solid double dashed dotted inset outset groove ridge No border A single solid line this is 1pt solid black Two lines separated by a gap The gap is 1 3 of the width of the border this is 4pt black double See example this is 2pt black dotted The top and left borders are slightly darker then the required color and the bottom and right borders are slightly lighter this is 2pt blue inset See example this is 2pt blue outset See example See example Sets the top border color For example border top color red Elements and Attributes 321 25 11 47 Figure 25 61 Ibex PDF Creator Developers Guide Default value the value of the color property Values lt color gt A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color inherit border top style Description Sets the
24. Ibex is developed entirely in C and requires the Microsoft NET Runtime to be installed NET 1 0 1 1 2 0 3 0 3 5 and 4 0 are supported All Microsoft operating systems which support NET are supported by Ibex Introduction 3 4 Introduction 2 1 22 Chapter 2 Installation The latest version of Ibex can be downloaded from http www xmlpdf com downloads net html The download file is a Windows Installer MSI file which can be installed by double clicking on it in Windows Explorer By default Ibex is installed in the following directory c program files visual programming ibex pdf creator n n n where n n n is the version number So for example Ibex 4 1 2 is installed in c program files visual programming ibex pdf creator 4 1 2 Multiple versions of Ibex can be installed and used on one machine at the same time Assemblies installed Ibex PDF Creator Standard Edition The installation process installs these NET assemblies used by Ibex NET Version Assembly Description 1 0 32bit ibex1o dll Main Ibex assembly ibex10 exe Ibex command line utility 1 1 32bit ibext1 dll Main Ibex assembly ibex11 exe Ibex command line utility 2 0 32bit ibex20 dll Main Ibex assembly ibex20 exe Ibex command line utility 3 5 32bit ibex35 dll Main Ibex assembly ibex35 exe Ibex command line utility 4 0 32bit ibex4o dll Main Ibex assembly ibex40 exe Ibex command line utility Assemblies instal
25. Notes XX_Small string 7 opt Must end in pt X_Small string 8 3pt Must end in pt Small string 10 0pt Must end in pt Medium string 12 0pt Must end in pt Large string 14 4pt Must end in pt X_Large string 17 4pt Must end in pt XX_Large string 20 7pt Must end in pt Property Type Default Notes Smaller string 0 8em Must end in em Larger string 1 2em Must end in em 21 2 Line height The following properties on the Settings change the default line height Ideally Settings LineHeightNormal should end in em to make line height proportional to the font height Property Type Default Notes LineHeightNormal string 1 2em 21 3 Page size The following properties on the Settings change the default page size Property Type Default Notes PageHeight string 297mm PageWidth string 210mm 132 Configuration Ibex PDF Creator 21 4 Include paths Developers Guide The following properties on the Settings effect retrieving XML or XSL files Property Type Default Notes BaseURI_XML string This value sets the base URI for including images and other XML files When an external graphic element specifies a relative path Settings BaseURI_XML is the base URI used in accordance with the rfc2396 URI Specification When an XML file uses an entity to include another XML file Settings BaseURI_XML is the bas
26. PDF 26 7 Formatting objects for indexing Element index page number prefix Status implemented Compliance with the XSL FO standard 375 Ibex PDF Creator Developers Guide Element index page number suffix Status implemented index range begin implemented index range end implemented index key reference implemented index page citation list implemented index page citation list separator implemented index page citation range separator implemented 26 8 Formatting objects for bookmarks Element bookmark tree Status implemented bookmark implemented bookmark title implemented 26 9 Out of line formatting objects Element Status float implemented footnote implemented footnote body implemented 26 10 Other formatting objects Element change bar begin Status implemented change bar end implemented wrapper implemented marker implemented retrieve marker implemented retrieve table marker implemented 376 Compliance with the XSL FO standard
27. The output created by the FO appears in Figure 15 29 lt table gt lt table column column width 100 gt header lt table header gt lt table row gt lt table cell border 1pt solid black padding 5pt gt lt block gt Heading lt block gt lt table cell gt lt table row gt lt table header gt lt table body gt lt table row gt lt table cell border 1pt solid black padding 5pt gt lt block gt row 1 lt block gt lt table cell gt lt table row gt lt table row border l1pt solid black padding 5pt gt lt table cell gt lt block gt row 2 lt block gt lt table cell gt lt table row gt lt table body gt lt table gt Figure 15 29 header Table with simple AQ row 1 row 2 Table headers are repeated at the top of the table after each page break This is the default To prevent the table header appearing on pages after the first specify table omit header at break true on the table element Table footers Table footers are created using the table footer element The table footer should appear inside the table element after any table column and table header elements and before any table body elements The table footer element is similar in structure to a table body element in that it contains table row elements It is a common error to place the table footer element at the end of the table after the table body elements It must be placed before the table body elements becaus
28. align are shown in the table below Value Effect left text is aligned against the left edge of the block right text is aligned against the right edge of the block Text Formatting 55 Ibex PDF Creator Value Developers Guide Effect center text is centered in the middle of the block justify text is aligned against both the left and right edges of the block Space is inserted between words to achieve this effect Setting text align justify does not align the last line of the paragraph this is done using text align last justify start text is aligned against the start edge which for a block that is not rotated with the default left to right writing direction is the left edge end text is aligned against the end edge which for a block that is not rotated with the default left to right writing direction is the right edge inside assuming the document is to be bound as a book text is aligned against the edge which is nearest the binding For an odd numbered page this will be the left edge for an even numbered page it will be the right edge outside assuming the document is to be bound as a book text is aligned against the edge which is furtherest from the binding For an odd numbered page this will be the right edge for an even numbered page it will be the left edge For text align values of inside and outside the page number is used to determine the binding edge
29. an alignment baseline value of baseline and so sits on the baseline shown in the above diagrams For a given line the largest thing on that line which has alignment baseline baseline establishes the position of the before edge baseline This is shown in Figure 9 41 before edge baseline Figure 9 41 Image aligned to before edge baseline 40pt To align another object with the before edge baseline either set vertical align top or alignment baseline before edge baseline Figure 9 42 shows a second smaller image with default alignment which positions it on the baseline Figure 9 42 before edge baseline Differently aligned images 40pt By specifying vertical align top on the external graphic for the second image we can align this image to the before edge baseline and get the layout shown in Figure 9 43 baseline before edge baseline Figure 9 43 Two images aligned using vertical align 40pt If all the elements on the line have vertical align top then the before edge baseline cannot be calculated so the text before edge baseline is used This is the top of the ascender for the font specified for the block which contains the elements baseline 64 Text Formatting 10 1 Chapter 10 Fonts Ibex supports TrueType and Type 1 Postscript fonts Font information is read from the registry at runtime no configuration of fonts is required Information on
30. and Attributes 153 Zo Vs Ibex PDF Creator Developers Guide color profile Description This element is used to specify an external color profile file used in the creation of PDF X files See 143 for more information Parent element s This element can be contained in the following elements declarations Attributes The following attributes can be used on this element src color profile name rendering intent 154 Elements and Attributes 25 1 4 Ibex PDF Creator Developers Guide page sequence Description This element contains content for one or more pages The content is contained in static content elements which hold content for the page header footer and other regions and a one or more flow elements which contains content to be placed in the body regions of the page The page sequence has a master reference attribute which should correspond to the master name of an element contained within the documents layout master set such as a single page master The page number for the first page created by this page sequence can be set using the initial page number attribute The format of the page number is controlled using the format attribute Child element s This element can contain the following elements flow one or more folio prefix zero or more folio suffix zero or more static content zero or more title zero or more Parent element s This element can be contained in the following elem
31. and Attributes 335 25 11 74 Figure 25 75 Figure 25 76 Figure 25 77 Figure 25 78 Ibex PDF Creator Developers Guide same as one of the region names the content contained in the flow and static content is discarded Default value This attribute has no default value you must provide a value Values lt name gt use a value which matches a region name used on one of the regions on the current simple page master font Description This attribute is shorthand for the font style font variant font weight font size font family line height attributes Typically the font attribute will be set to a value which defines the font name and size plus possibly bold or italic Some example of this are font 12pt arial font bold 12pt arial font bold 12pt minion regular The elements of the font attribute must be specified in this order style normal italic variant normal smallcaps weight bold bolder lighter etc size 1em 12pt line height 12pt 14pt font family helvetica If the font name contains spaces it should be placed in quotes If the attribute value is in single quotes place the font name in double quotes like this font 12pt minion regular 336 Elements and Attributes Figure 25 79 20 11 70 Figure 25 80 Figure 25 81 Figure 25 82 Figure 25 83 Ibex PDF Creator Developers Guide If the attribute value is in double quotes place the font name in single quotes
32. and table footer elements are automatically repeated at each page break although this can be suppressed if required Figure 4 38 shows the FO for a simple table and Figure 4 39 shows the table created from the FO Figure 4 38 Sees FOforatable lt table body gt lt table row gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 1 column 1 lt block gt lt table cell gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 1 column 2 lt block gt lt table cell gt lt table row gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 1 column 1 lt block gt lt table cell gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 1 column 2 lt block gt lt table cell gt lt table row gt lt table body gt lt table gt This FO produces the table shown in Figure 4 39 Figure 4 39 Simple table from the above FO The padding and border attributes are not inherited from containing elements so must be defined on the table cell elements 4 10 1 Setting table column widths The width of a table column is set using the table column element A table element contains zero or more table column elements each of which defines properties such as width and background color for a column in the table To make the first column 30 of the table width we would add table column elements as shown in Figure 4 40 w
33. as a single word The non breaking space can be inserted into XML using the amp xAo entity The example in Figure 12 9 shows a block used in a table header It contains the three words Score per 100 The default formatting is shown in Figure 12 10 If we want to move the word per to the next line to keep it with the 100 we replace the space between per and 100 with a non breaking space This will prevent Ibex breaking the line between the per and 100 words Figure 12 11 shows the FO with a non breaking space and Figure 12 12 shows the resulting output Figure 12 9 lt block container width 2 8cm gt FO withouta lt plock border 1pt solid black non breaking space padding 3pt text align center gt Score per 100 lt block gt lt block container gt Figure 12 10 Output without a Score per non breaking space 100 Figure 12 11 lt fo block container width 2 8cm gt FO with non breaking lt fo block border l1pt solid black space padding 3pt text align center gt Score per amp xA0 100 lt fo block gt lt fo block container gt Figure 12 12 Output with a TE non breaking space per 100 Space Handling 71 72 Space Handling Chapter 13 Colors XSL FO defines various attributes for managing color By default a block is displayed with the foreground color that is the text being black and the background color being white Colors are most commonly expressed using the RGB colo
34. as their fill color will appear differently if they are placed in different locations on the page This SVG image shows rectangles using the same gradient in conjunction with gradientUnits userSpaceOnUse lt xml version 1 0 standalone no gt lt svg width 8cm height 3cm viewBox 0 0 1000 550 version 1 1 xmlns http www w3 org 2000 svg gt lt g gt lt defs gt lt radialGradient id radial_userSpaceOnUse gradientUnits userSpaceOnUse cx 400 cy 200 r 300 fx 400 fy 200 gt lt stop offset 0 stop color green gt lt stop offset 50 stop color blue gt lt stop offset 100 stop color red gt lt radialGradient gt lt defs gt lt rect fill none stroke blue x 1 y 1 width 990 height 530 gt lt rect fill url radial_userSpaceOnUse stroke black stroke width 5 x 100 y 100 width 600 height 200 gt lt rect fill url radial_userSpaceOnUse stroke black stroke width 5 x 100 y 310 width 600 height 200 gt lt g gt lt svg gt producing the image below in which you can clearly see the gradient circles are centered within the first rectangle When gradientUnits objectBoundingBox the specified values are relative to the bounding box of the element being filled and should be expressed as fractions of the dimensions of the element being filled The values for coordinates should be in the range o 1 so for example specifying x1 0
35. attributes on the cells to determine where rows start and end The height of a row is by default the height of the tallest cell in the row This can be overridden using the height or block progression dimension attributes Use block progression dimension minimum to set a minimum height block progression dimension maximum to set a maximum height Rows cannot have padding This is stated in section 6 7 9 of the XSL FO specification Child element s This element can contain the following elements table cell one or more Parent element s This element can be contained in the following elements table header table footer table body Attributes The following attributes can be used on this element background attachment background color background image background repeat background position horizontal background position vertical border border before color border before style border before width border after color border after style border after width border start color border start style border start width border end color border end style border end width border top Elements and Attributes 247 Ibex PDF Creator border top color border top width border bottom color border bottom width border left color border left width border right color border right width border before color border before width border after style border start color border start width border end style border top border top style border bottom bor
36. break to true on the containing table A table footer is itself a table and contains rows and cells in the same manner as table element Child element s This element can contain the following elements table cell zero or more table row zero or more Parent element s This element can be contained in the following elements table Attributes The following attributes can be used on this element background attachment background color background image background repeat background position horizontal background position vertical border border before color border before style border before width border after color border after style border after width border start color border start style border start width border end color border end style border end width border top border top color border top style border top width border bottom border bottom color border bottom style border bottom width border left border left color border left style Elements and Attributes 243 Ibex PDF Creator border left width border right color border right width font selection strategy font stretch font style font weight margin top margin right space before start indent relative position top left border before precedence border end precedence index class visibility Notes on attributes Developers Guide border right border right style font family font size font size adjust font variant margin margin bottom margi
37. can be used to position an image or other elements to the side or top of the page and cause text to flow around that image The paragraph in Figure 11 1 uses two float elements to make the image appear on the left and right sides with the text flowing around the images below them Figure 11 1 Left and right floats Lorem ipsum dolor sit amet consectetuer adipiscing elit Duis in dolor quis lectus cursus condimentum Vestibulum id nunc vitae dui semper ultrices Mauris a mi Phasellus eu lacus Pellentesque eu ligula mattis odio faucibus faucibus Aliguam sit amet nunc laoreet tellus ullamcorper malesuada Vestibulum ante Ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae Cras nec mauris Proin cursus tincidunt leo Maecenas metus lacus imperdiet fermentum blandit at sollicitudin eu sem Duis elementum libero vitae lacus Curabitur justo Aliquam erat volutpat Maecenas nec nulla in massa consectetuer volutpat Aenean turpis nisl rutrum a posuere sit amet varius in enim Praesent risus Nam volutpat enim eget neque Maecenas a dui ac felis nonummy sollicitudin Proin iaculis Vestibulum in eros sit amet libero mollis convallis nunc laoreet tellus ullamcorper malesuada Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae Cras nec mauris Proin cursus tincidunt leo Maecenas metus lacus imperdiet fermentum blandit at sollicitudin eu sem Duis elementum libero vitae lacus Curabi
38. causes the two edges to be in the same place Positive values of right move the right edge of the block container to the left making the block container smaller The distance between the top edge of the block container and the top edge of the containing reference area is set by the top attribute This attribute specifies the offset of the block container s top edge from the containing reference area s top edge The default value is opt which causes the two edges to be in the same place Positive values of top move the top edge of the block container downwards making the block container smaller The distance between the bottom edge of the block container and the bottom edge of the containing reference area is set by the bottom attribute This attribute specifies the offset of the block container s bottom edge from the containing reference area s bottom edge The default value is opt which causes the two edges to be in the same 124 Absolute Positioning Figure 18 3 block containers positioned and sized Ibex PDF Creator Developers Guide place Positive values of bottom move the bottom edge of the block container upwards making the block container smaller If none of the left right top or bottom attributes is specified the block container will be the same size as the reference area which contains it This is because the offsets all default to opt so the edges of the block container are the same as the edges of its containing refe
39. class name continued If this is not the case then the footer content will never change The retrieve position attribute specifies which marker to retrieve In this example we want the first marker which appears on the page so we use retrieve position Tables 91 Ibex PDF Creator Developers Guide first starting within page We also specify retrieve boundary table so any marker from any part of the table which has been output to PDF can be retrieved Other options are detailed later in this section Conceptually Ibex looks at every row in the table which has been output to the PDF file including rows on the current page collects all the markers associated with each of those rows and selects one to go into the footer Markers associated with rows which are not on either the current page or prior pages are not considered It is possible to have a different marker associated with every row in the table This is useful for situations such as like rendering a running total The second part of the process is to define one or more marker elements In this case our marker elements are associated with table row elements The first table row has a marker element which specifies the continued on next page text The contents of this marker will be retrieved for all pages except the last The last row of the table has an empty marker element The content of this that is to say no rows will be what appears in the footer on the last page of
40. clip extent precedence reference orientation Developers Guide border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right display align overflow region name writing mode For an example showing the use of the element see Figure 25 5 Elements and Attributes 169 20 1 15 Ibex PDF Creator Developers Guide region after Description This element defines the shape of a region which is at the bottom of a non rotated page Content from static content elements whose flow name matches the region name will be placed in this region The region has a default name of xsl region after which is usually changed to something simpler such as footer using the region name attribute Within the region all of the content can be aligned to the top bottom or middle of the region using the display align attribute The content of the region can be rotated using the reference orientation attribute Unlike the region body element the region after does not have margin properties The size of the region is defined using the extent attribute By default the before region is reduced in width by the presence of the region start and region end elements This can be changed by setting the precedence attribute to true Child element s This element can contain the following elements This element must be empty
41. clockwise from the top like this border color red blue green black Default value Shorthand properties do not have default values See individual properties for their default values Values lt color gt A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color transparent inherit 306 Elements and Attributes Ibex PDF Creator Developers Guide 25 11 28 border end color Description Sets the end border color the right side of a non rotated page For example Figure 25 37 border end color red Default value the value of the color property Values lt color gt A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color inherit 25 11 29 border end style Description Sets the end border style the right side of anon rotated page For example Figure 25 38 g 53 border end style solid Default value none Values lt border style gt Can be any of the values none No border solid A single solid line this is 1pt solid black double Two lines separated by a gap The gap is 1 3 of the width of the border this is 4pt black double dashed See example this is 2pt black dashed i Pee d dotted See example Elements and Attributes 307 25 11 30 Figure 25 39 Ibex PDF Creator Developers Guide inset outset groove ridge inherit border end width Desc
42. elements block zero or more block container zero or more float one or more cannot be used inside an out of line element index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element list block zero or more retrieve marker one or more subject to constraints specified for this element table zero or more table and caption zero or more wrapper one or more subject to constraints specified for this element Parent element s This element can be contained in the following elements table header table row table footer table body Attributes The following attributes can be used on this element background attachment background color background image background repeat Elements and Attributes 249 Ibex PDF Creator background position horizontal border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left relative position top left border before precedence border end precedence column number relative align ends row id index key number columns spanned starts row 250 Elements and Attributes Developers Guide background position
43. extends the full width of the page If we had side regions region start and region end this might change but in this example we have no side regions The height of the region created by the region after element is defined by the extent attribute In this example we have extent 1cm so the region will be 1cm high and end at the bottom of the page 14 Introduction to XSL FO Ibex PDF Creator Developers Guide Even without any content the footer region is still rendered on the page Our page now looks like the one in Figure 4 10 Figure 4 10 A basic page with a footer region Hello World In its current position on the page the footer region will not print on most printers because they do not print right to the edge of the paper We can define a margin around the whole page by setting the margin attribute on the simple page master element of the page sequence as shown in Figure 4 11 Figure 4 11 lt layout master set gt Simple page master lt simple page master master name simple with margin added margin 2 5cm gt lt region body margin 2 5cm region name body background color eeeeee gt lt region after extent 1cm region name footer background color dddddd gt lt simple page master gt lt layout master set gt The area inside the margins of the simple page master is called the content area The area covered by the regions defined by the region body and region end is measured from the inside of
44. file specify the names of the FO and PDF files on the command line For example to create hello pdf from hello fo you do this ibex20 hello fo hello pdf If the names of the input and output files are the same ignoring the extensions you can abbreviate this to ibex20 hello fo and if the file extension of the input file is fo or xml you can abbreviate even further to ibex20 hello Error logging Any informational or error messages will be logged to the console To send any error messages to a file as well use the logfile option For example to log errors to the file ibex log the command becomes ibex20 logfile ibex log hello fo hello pdf Getting Started with Ibex 7 3 3 Figure 3 1 Ibex PDF Creator Developers Guide An example without XSLT translation The Ibex command line program will create a PDF file from either a an FO file or b an XML file with an XSLT stylesheet This section shows how to create a PDF file from an FO file This example uses the FO file hello fo shown in Figure 3 1 lt xml version 1 0 encoding UTF 8 gt Hello World FO lt root xmins http www w3 org 1999 XSL Format gt 3 4 lt layout master set gt lt simple page master master name page gt lt region body margin 2 5cm region name body gt lt simple page master gt lt layout master set gt lt page sequence master reference page gt lt flow flow name body gt lt block gt Hello World lt bloc
45. fo stiminput Position 0 Kill hellostream pdf Dim strmPDF As New Stream strmPDF Open ibex GenerateXMLStreamPDFStream strmInput strmPDF True Set strmInput Nothing save the PDF stream to file just to show it works strmPDF Position 0 will get write error here if file exists strmPDF SaveToFile hellostream pdf Set strmPDF Nothing Set ibex Nothing test xgit translation and pdt creation Set ibex New ibexcom Wrapper Dim strmXML As New Stream strmXML Open must match encoding of fo file or will get invalid data at 1 1 message strmXML Charset utf 8 strmXML LoadFromFile book xml1 strmXML Position 0 Dim strmxXSL As New Stream strmXSL Open must match encoding of fo file or will get invalid data at 1 1 message sermoi Charset Mut o4 strmXSL LoadFromFile book xsl strmxXSL Position 0 Using Ibex with Visual Basic and ASP 149 Ibex PDF Creator Developers Guide Set strmPEDE New Stream strmPDF Open ibex GenerateXMLStreamxXSLStreamPDFStream strmXML strmXSL strmPDF True Set strmXML Nothing Set strmXSL Nothing save the PDF stream to file just to show it works strmPDF Position 0 strmPDF SaveToFile helloxsl pdf Set strmPDF Nothing Set ibex Nothing End errorhandler MsgBox Err Description End End Sub Key things to note are A PDF file can be created from an FO file to a PDF file on disk using this call ibex GenerateFileFile hello fo
46. gt Simple FO file lt root xmlns http www w3 org 1999 XSL Format gt 4 1 1 lt layout master set gt lt simple page master master name simple gt lt region body margin 2 5cm region name body background color eeeeee gt lt simple page master gt lt layout master set gt lt page sequence master reference simple gt lt flow flow name body gt lt block gt Hello World lt block gt lt flow gt lt page sequence gt lt root gt This file is logically in three parts namely the root layout master set and page sequence parts All FO files share this structure Namespaces The examples used in this manual follow the style shown in Figure 4 1 where the XSL FO namespace is set on the root element as the default namespace for the file Namespace prefixes are not used for the FO elements such as block Figure 4 2 shows the same FO as Figure 4 1 but without the default namespace Each element has the fo namespace prefix The files shown in Figure 4 1 and Figure 4 2 both create the same output and are treated equally by Ibex Using namespaces is a matter of preference it does not effect performance Introduction to XSL FO 11 Ibex PDF Creator Developers Guide Figure 4 2 8 4 lt xml version 1 0 encoding UTF 8 gt Simple XML using the lt fo root xmlns fo http www w3 org 1999 XSL Format gt fo prefix lt fo layout master set gt lt fo simple page master master name simple gt l
47. gt block container using some text lt block container gt another block container 18 2 lt block container absolute position absolute height 2cm top 3cm gt lt block gt in block container one lt block gt lt block container gt lt block container gt lt block gt lt block gt some more text lt block container gt lt block container absolute position absolute height 2cm top 3cm gt lt block gt in block container two lt block gt lt block container gt lt block container gt lt block gt lt flow gt Positioning and sizing block containers A block container with absolute position absolute is positioned relative to its containing reference area The distance between the left edge of the block container and the left edge of the containing reference area is set by the left attribute This attribute specifies the offset of the block container s left edge from the containing reference area s left edge The default value is opt which causes the two edges to be in the same place Positive values of left move the left edge of the block container to the right making the block container smaller The distance between the right edge of the block container and the right edge of the containing reference area is set by the right attribute This attribute specifies the offset of the block container s right edge from the containing reference area s right edge The default value is opt which
48. gt lt table body gt lt table gt 236 Elements and Attributes Ibex PDF Creator Developers Guide Percentage values used in the column width attribute refer to the width of the table If table column elements are not used all columns will be of equal width Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements table Attributes The following attributes can be used on this element background attachment background image background position horizontal border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top background color background repeat background position vertical border before color border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom Elements and Attributes 237 Ibex PDF Creator 238 padding left border after precedence border end precedence column number number columns repeated visibility Elem
49. in the XML use the linefeed treatment attribute To change the color of text use the color attribute To align a paragraph to the left right or both margins use the text align and text align last attributes A block may contain a retrieve marker only if the block is inside a static content element Child element s This element can contain the following elements basic link zero or more bidi override zero or more Elements and Attributes 187 Ibex PDF Creator Developers Guide block zero or more block container zero or more character zero or more external graphic zero or more float one or more cannot be used inside an out of line element footnote one or more cannot be used inside an out of line element index page citation last zero or more index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element inline zero or more inline container zero or more instream foreign object zero or more leader zero or more list block zero or more page number zero or more page number citation zero or more page number citation last zero or more PCDATA retrieve marker one or more subject to constraints specified for this element scaling value citation zero or more table zero or more table and caption zero or more wrapper one or more subject to constraints specified for this elemen
50. index key reference one or more index page citation list separator zero or one index page citation range separator zero or one Parent element s This element can be contained in the following elements Attributes The following attributes can be used on this element merge sequential page numbers merge ranges across index key references merge pages across index key references 280 Elements and Attributes Ibex PDF Creator Developers Guide 25 10 Other formatting objects Elements and Attributes 281 25 10 1 Ibex PDF Creator Developers Guide change bar begin Description This element marks the start of a change region and causes a change bar to be drawn on the side of the containing region from the point this element occurs to the location of the matching change bar end element Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements Attributes The following attributes can be used on this element change bar class change bar color change bar offset change bar placement change bar style z index 282 Elements and Attributes 25 10 2 Ibex PDF Creator Developers Guide change bar end Description This element marks the end of a change region and causes a change bar to be drawn on the side of the containing region from the location of the matching change bar begin this elemen
51. inline container zero or more instream foreign object zero or more leader zero or more page number zero or more page number citation zero or more page number citation last zero or more retrieve marker one or more subject to constraints specified for this element scaling value citation zero or more wrapper one or more subject to constraints specified for this element Parent element s This element can be contained in the following elements 226 page sequence Elements and Attributes 25 3 14 Ibex PDF Creator Developers Guide scaling value citation Description This element is used to retrieve the amount by which an image was scaled when it was inserted into the PDF file The image should be identified with an id attribute which has the same value as the ref id attribute on this element Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title block inline folio suffix folio prefix bidi override marker Attributes The following attributes can be used on this element background attachment background color background image background repeat background position horizontal background position vertical border border befor
52. last page number on which the content created by some other element occurs The page number string is formatted using the string conversion properties of the containing page sequence namely format grouping separator grouping size letter value country and language The page number citation last has a ref id attribute which should match the id attribute of the element whose page number we want to appear Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title block inline folio suffix folio prefix bidi override marker Attributes The following attributes can be used on this element background attachment background color background image background repeat background position horizontal background position vertical border border before color border before style border before width border after color border after style 222 Elements and Attributes Ibex PDF Creator border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left font family font size font size adjust font variant margin margin bottom margin left bottom right alignm
53. layout formatting objects Element root Status implemented declarations implemented color profile implemented page sequence implemented page sequence wrapper implemented layout master set implemented page sequence master implemented single page master reference implemented repeatable page master reference implemented repeatable page master alternatives implemented conditional page master reference implemented layout master set implemented simple page master implemented region body implemented region before implemented region after implemented region start implemented region end implemented Compliance with the XSL FO standard 373 Ibex PDF Creator Developers Guide Element flow Status implemented static content implemented title implemented flow map implemented flow assignment implemented flow source list implemented flow name specifier implemented flow target list implemented region name specifier implemented 26 2 Block level formatting objects Element block Status implemented block container implemented 26 3 Inline level formatting objects Element Status bidi override implemented character implemented initial property set not impl
54. layout master set gt lt page sequence master reference simple gt lt flow flow name body gt lt block gt Hello World lt block gt lt flow gt lt page sequence gt Within the flow element we can have one or more block level elements These are elements such as list block and table which define the content to appear on the page In this example we have a single block element containing the text Hello World Introduction to XSL FO 13 Ibex PDF Creator Developers Guide This produces a page like the one shown in Figure 4 8 The region created by the region body element has a shaded background so you can see how large it is Figure 4 8 A basic page with a region body and some Hello World text 4 2 Adding a footer region In our example so far all the text contained in the flow element goes into the body region in the center of the page To add a page footer we need to define a new region on the page and then define some new content to go into that region We define a footer region by adding a region after element into the existing simple page master as shown in Figure 4 9 Figure 4 9 g 13 lt layout master set gt Simple page master lt simple page master master name simple gt with footer region sss lt region after extent 1cm region name footer background color dddddd gt lt simple page master gt lt layout master set gt The region after element defines an area on the page which
55. like this font 12pt minion regular Default value Shorthand properties do not have default values See individual properties for their default values font family Description This sets the font family for the element This attribute can be set to a single font name like this font family arial or alist of fonts separated by commas like this font family arial minion regular If the font name contains spaces it should be placed in quotes If the attribute value is in single quotes place the font name in double quotes like this font 12pt minion regular If the attribute value is in double quotes place the font name in single quotes like this font 12pt minion regular In addition to actual font names the following values can be used serif sans serif cursive fantasy monospace These names are mapped to actual font names by the Settings Default value The value of Settings DefaultFontFamily or inherited from parent Elements and Attributes 337 20 11 76 Figure 25 84 Figure 25 85 Figure 25 86 Ibex PDF Creator Developers Guide font size Description This sets the font size of this element and the elements it contains Typical values are show here font size 12pt font size 1 2em Values which set the font size relative to the font size of the containing element can also be used like this font size smaller Percentage sizes refer to the font s
56. lt border style gt inherit 25 11 25 border bottom width Description Can be any of the values none solid double dashed dotted inset outset groove ridge No border A single solid line this is 1pt solid black Two lines separated by a gap The gap is 1 3 of the width of the border this is 4pt black double See example F this is 2pt black dotted The top and left borders are slightly darker then the required color and the bottom and right borders are slightly lighter this is 2pt blue inset See example this is 2pt blue outset See example See example Sets the bottom border width For example Figure 25 32 border bottom width 1pt Default value medium 304 Elements and Attributes 20 17 26 Ibex PDF Creator Values lt border width gt inherit border collapse Description Developers Guide Can be any of the values thin A thin border The actual default width is Settings BorderWidthThin and so can be changed programatically medium A medium border The actual default width is Settings BorderWidthMedium and so can be changed programatically thick A thick border The actual default width is Settings BorderWidthThick and so can be changed programatically lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points Controls whether borders on adjacent rows
57. lt region body margin 2 5cm region name body background color eeeeee gt lt region befor xtent 2 5cm region name header background color dddddd gt lt region after extent 2 5cm region name footer background color dddddd gt lt region start extent 2 5cm region name start background color aaaaaa gt lt region end extent 2 5cm region name end background color aaaaaa gt lt simple page master gt region after 50 Layout examples region before region body This page layout is created with the XML below Note that the region before and region after regions have precedence true so they extend the full width of the page and the side regions are reduced in height to the regions do not overlap lt simple page master master name region example 1 gt lt region body margin 2 5cm region name body background color eeeeee gt lt region before extent 2 5cm region name header precedence true background color dddddd gt lt region after extent 2 5cm region name footer precedence true background color dddddd gt lt region start extent 2 5cm region name sStart background color aaaaaa gt lt region end extent 2 5cm region name end background color aaaaaa gt lt simple page master gt region after Layout examples 51 52 Layout examples Chapter 9 Text Formatting Text is created in the output document
58. lt table column column width 50 gt lt table body gt lt table row gt lt table cell gt col 1 lt table cell gt lt table cell gt col 2 lt table cell gt lt table cell gt col 3 lt table cell gt lt table row gt lt table body gt lt table gt This defines a table with three columns Implicitly the three table column elements specify the width of columns one two and three in that order This can be made explicit using the column number attribute like this Figure 25 14 aces lt table column column number 1 column width 20 gt lt table column column number 2 column width 30 gt lt table column column number 3 column width 50 gt lt table body gt lt table row gt lt table cell gt col 1 lt table cell gt lt table cell gt col 2 lt table cell gt lt table cell gt col 3 lt table cell gt lt table row gt lt table body gt lt table gt A single table column can be used to set the width and other characteristics of multiple columns by using the columns spanned attribute In the example below the first table column sets the width of the first two columns to 20 and the third column to 50 Figure 25 15 Bie lt table column columns spanned 2 column width 20 gt lt table column column width 50 gt lt table body gt lt table row gt lt table cell gt col 1 lt table cell gt lt table cell gt col 2 lt table cell gt lt table cell gt col 3 lt table cell gt lt table row
59. of the two spaces i e 10cm not the sum FO showing this is in Figure 9 24 and the output is in Figure 9 25 Figure 9 24 hiss FO showing merging lt inline space end lcem gt hello lt inline gt of spaces lt inline space start 0 5cm gt world lt inline gt lt block gt Figure 9 25 The resulting 1 0cm space hello world 9 12 Forcing a line break You can cause a line break in normal text by inserting an empty block element Figure 9 26 shows an FO example which does this and Figure 9 27 shows the resulting output Fi 26 igure 9 26 aoas Forcing a line break this will be line one lt block gt this will be line two lt block gt Figure 9 27 this will be line one Line break created this will be line two with an empty block 9 13 Space at the start of a line Space specified with the space start attribute is normally discarded at the start of the line To force it to be retained use the space start conditionality attribute Figure 9 28 shows two blocks which create two lines The first block will have no space at the start of the word The second block has space start conditionality retain so the space specified by the space start 1cm will be retained The output created by this FO is shown in Figure 9 29 Figure 9 28 _ lt block background color eeeeee gt Using retain lt inline space start lcem gt discard lt inline gt lt block gt lt block background color eeeeee gt lt inl
60. output By pressing Control U in Acrobat Reader you can measure the content and see that the area within the borders is 3cm high Note that the width and height attributes do not apply to the fo block element To set minumum and maximum height values use the block progression dimension attribute Default value auto 25 11 81 id Description This attribute is set on elements which need to be referenced from somewhere else in the document An example of this is the page number citation element which inserts into the document the page number some other content appears on The content whose page number we want to retrieve is given an id attribute and the page number citation sets its ref id attribute to the same value An example of this is Elements and Attributes 341 Ibex PDF Creator Developers Guide Figure 25 89 lt xml version 1 0 encoding UTF 8 gt lt root xmlns fo http www w3 org 1999 XSL Format gt lt layout master set gt lt simple page master master name simple gt lt region body margin 2 5cm region name body gt lt simple page master gt lt layout master set gt lt page sequence master reference simple gt lt flow flow name body gt lt block id 22 gt Hello lt block gt lt flow gt lt page sequence gt lt page sequence master reference simple gt lt flow flow name body gt lt block gt The block with id 22 is on page lt page number citation ref id 22 gt
61. padding after padding end padding bottom padding right font selection strategy font stretch font style font weight margin top margin right relative position top left alignment baseline dominant baseline index class keep with next letter spacing Ibex PDF Creator Developers Guide line height ref id score spaces text altitude text decoration text depth text shadow text transform visibility word spacing wrap option For an example showing the use of the element see Figure 25 12 Figure 25 12 lt xml version 1 0 encoding UTF 8 gt Example of lt root xmlns http www w3 org 1999 XSL Format gt page number citation lt layout master set gt lt simple page master master name simple gt lt region body margin 2 5cm region name body gt lt simple page master gt lt layout master set gt lt page sequence master reference simple gt lt flow flow name body gt lt block id 22 gt Hello lt block gt lt flow gt lt page sequence gt lt page sequence master reference simple gt lt flow flow name body gt lt block gt The block with id 22 starts on page lt page number citation ref id 22 gt and ends on page lt page number citation last ref id 22 gt lt block gt lt flow gt lt page sequence gt lt root gt Elements and Attributes 221 25 3 11 Ibex PDF Creator Developers Guide page number citation last Description This element is used to insert the
62. page It can also be set to before to position the float at the start of the next page Floats 67 Figure 11 2 Ibex PDF Creator Developers Guide lt block font size 1 0em text align justify gt FO for float example efloat float lett gt 11 1 lt block container inline progression dimension 2 5cm gt lt block text align center gt lt external graphic src url ibexorange jpg content width 50 padding 3pt gt lt block gt lt block container gt lt float gt Lorem ipsum dolor sit amet consectetuer adipiscing elit Duis in dolor quis lectus cursus condimentum Vestibulum id nunc vitae dui semper ultrices Mauris a mi Phasellus eu lacus Pellentesque eu ligula mattis odio faucibus faucibus Aliquam sit amet lt float float right gt lt block container inline progression dimension 2 5cm gt lt block text align center gt lt external graphic src url ibexorange jpg content width 50 padding 3pt gt lt block gt lt block container gt lt float gt nunc laoreet tellus ullamcorper malesuada Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae Cras nec mauris Proin cursus tincidunt leo Maecenas metus lacus imperdiet fermentum blandit at sollicitudin eu sem Duis elementum libero vitae lacus Curabitur justo Aliquam erat volutpat Maecenas nec nulla in massa consectetuer volutpat Aenean turpis nisl rutrum a posuere sit amet varius in enim P
63. range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element list block zero or more retrieve marker one or more subject to constraints specified for this element table zero or more table and caption zero or more wrapper one or more subject to constraints specified for this element Parent element s This element can be contained in the following elements wrapper basic link float footnote body static content table caption block block container Elements and Attributes 191 Ibex PDF Creator inline inline container bidi override table cell list item label list item body marker Attributes Developers Guide The following attributes can be used on this element 192 absolute position top left background color background repeat background position vertical border before color border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom Elements and Attributes bottom right background attachment background image background position horizontal border border before style border after color border after width border start style border end color border end width border top color bord
64. reducing the size of the label For example if provisional distance between starts is 5cm and the provisional label separation is 1cm then the start edges of the label and body will be 5cm apart and the label will be 4cm 5cm 1cm wide Lists 77 Ibex PDF Creator Developers Guide e each item in the list is contained in a list item element each list item must contain both a list item label and a list item body The list item label must come first the list item label should have the end indent attribute set to label end This is a special function which returns a value derived from provisional distance between starts and provisional label separation the list item body should have the start indent attribute set to body start This is a special function which returns a value derived from provisional distance between starts and provisional label separation e both the list item label and list item body contain one or more block level elements so a list item label or list item body can contain other block level elements such as block table and list block 14 1 Bulleted lists The example in Figure 14 1 also shows how to insert a Unicode character into the FO using the syntax amp x25CF This table shows some common bullet types for lists Result amp x25C6 amp x25C7 78 Lists Figure 14 3 Error message if bullet not in font Ibex PDF Creator Developers Guide Note that what is d
65. same value as the user password This means anyone who can open the document using the user password has complete control of the document Specifying the owner password but not the user password is common usage This means the user can open the document with limited rights without needing a password but cannot then change or exceed those rights without knowing the owner password 22 2 Standard document properties Ibex allows you to set the various properties associated with a PDF document These properties can be viewed in Acrobat by using the File Document Properties Summary menu option or just pressing control d Figure 22 2 shows FO for setting the document properties using the ibex properties element Figure 22 2 lt root xmlns http www w3 org 1999 XSL Format FO using xmins ibex http www xmlpdf com 2003 ibex Format gt ibex properties lt ibex properties title Ibex User Manual subject Ibex author visual programming limited keywords xml pdf creator xtransform gt If used the ibex security element must occur before any page sequence elements The attributes of the ibex properties element are Attribute Meaning title Specifies a string which becomes the title property of the document subject Specifies a string which becomes the subject property of the document author Specifies a string which becomes the author property of the document keywords Specifies a string which becomes the keywords pr
66. size adjust font variant margin margin bottom margin left bottom right alignment adjust alignment baseline character dominant baseline text altitude glyph orientation vertical index class keep with next 198 Elements and Attributes Developers Guide border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right font selection strategy font stretch font style font weight margin top margin right relative position top left treat as word space baseline shift color text depth glyph orientation horizontal id index key keep with previous Ibex PDF Creator letter spacing score spaces text decoration text transform word spacing Developers Guide line height suppress at line break text shadow visibility Elements and Attributes 199 25 3 3 Ibex PDF Creator initial property set Description Developers Guide This element is used to format the first line of a block It does not create any areas but its attributes are applied to the first line in the block which contains the initial property set Ibex does not currently implement this functionality Child element s This element can contain the following elements This element must be empty Parent element s This element can
67. skew the coordinate system angle degrees units along the Y axis Multiple transformations can be performed by placing them one after the other in the transform attribute like this lt g transform translate 10 20 scale 2 3 rotate 30 gt Transforms will be applied in the order in which they appear 108 Scalable Vector Graphics SVG images 17 4 3 17 4 4 17 4 5 17 4 6 17 4 7 Ibex PDF Creator Developers Guide lt defs gt The lt defs gt element is supported as a container for other elements See lt symbol gt below for an example lt desc gt The lt desc gt element is ignored lt title gt The lt title gt element is ignored lt symbol gt The lt symbol gt element is supported The following image shows an example of definining a system using lt symbol gt and retrieving it using lt use gt lt xml version 1 0 standalone yes gt lt svg width 10cm height 3cm viewBox 0 0 100 30 xmlns http www w3 org 2000 svg xmlns xlink http www w3 org 1999 xlink gt lt defs gt lt symbol id MySymbol viewBox 0 0 20 20 gt lt rect x 1 y 1 width 8 height 8 gt lt rect x 11 y 1 width 8 height 8 gt lt rect x 1 y 11 width 8 height 8 gt lt rect x 11 y 11 width 8 height 8 gt lt symbol gt lt defs gt lt use x 45 y 10 width 10 height 10 xlink href MySymbol fill blue gt lt svg gt The lt use gt element will find
68. specify starting state show on a bookmark or bookmark tree element it s immediate children will be visible when the PDF file is opened 130 Bookmarks Chapter 21 Configuration All configuration of Ibex is done using the Settings class which is accessed from the ibex4 FODocument object This class has many properties which can be changed to configure the operation of Ibex Properties of the Settings class should be changed prior to calling the generate method on the FODocument object The fact that the Settings object is a property of the FODocument object means that different documents can have different Settings values For example Figure 21 1 shows how to set the default line height to 1 4em Figure 21 1 using System Example usage of the Settings object using ibex4 public class IbexTester public static void Main string args FODocument doc new FODocument doc Settings LineHeightNormal 1 4em using Stream xml new FileStream args 0 FileMode Open FileAccess Read using Stream output new FileStream args 1 FileMode Create FileAccess Write doc generate xml output Configuration 131 Ibex PDF Creator 21 1 Fonts Developers Guide The following properties on the Settings change the way fonts a processed By default each absolute font size small medium large etc is 1 2 times larger than the previous size Property Type Default
69. start color red Default value the value of the color property Values lt color gt A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color inherit 25 11 42 border start style Description Sets the start border style the left side of anon rotated page For example Figure 25 53 8 5 53 border start style solid Default value none Values lt border style gt Can be any of the values none No border solid A single solid line this is 1pt solid black double Two lines separated by a gap The gap is 1 3 of the width of the border this is 4pt black double dashed See example this is 2pt black dashed i Pee d dotted See example Elements and Attributes 317 25 11 43 Figure 25 54 Ibex PDF Creator Developers Guide inset outset groove ridge inherit border start width Description this is 2pt black dotted The top and left borders are slightly darker then the required color and the bottom and right borders are slightly lighter this is 2pt blue inset See example this is 2pt blue outset See example See example Sets the start border width the left side of a non rotated page For example border start width l1pt Default value medium Values lt border width gt Can be any of the values thin A thin border The actual default width is Settings BorderWidthThin and so can be changed programa
70. string 3pt 21 7 Layout The following properties on the Settings change the appearance of content in the PDF file Property Type Default Notes OverflowlsVisible bool true By default a region has overflow auto leaving it up the Ibex to decide whether content which overflows the bottom edge of a region is displayed or discarded If Settings OverflowlsVisible is true the content will be displayed if false it will be discarded This property applies only if the XSL FO attribute overflow is not set or is set to auto 21 8 Leaders The following properties on the Settings change the values for leader formatting objects Property Type Default Notes LeaderDot char When leader pattern dots this is the character used as the dot 134 Configuration Chapter 22 Extensions This chapter details Ibex specific extensions to XSL FO Typically these extensions implement functionality such as password protecting a document which is not part of the XSL FO standard The Ibex extensions have a namespace which is specified using the xmlns attribute as shown in Figure 22 1 22 1 Document security Ibex supports encryption of PDF documents and the setting of various document permissions This is done using the ibex security element as shown in Figure 22 1 Figure 22 1 8 lt root xmlns http www w3 org 1999 XSL Format FO using the xmlns ibex http www xmlpdf com 2
71. support creating multiple PDF files concurrently on multiple threads as long as each PDF file is associated with a unique FODocument instance Example C code to convert the file manual fo to manual pdf the code is shown in Figure 5 1 the equivalent VB NET code is in Figure 5 2 30 Using Ibex Ibex PDF Creator Developers Guide Figure 5 1 using System C code to create a using ibex4 PDF from an FO file public class Simple static void Main string args FODocument doc new FODocument gen generate manual fo manual pdf Figure 5 2 Imports System VB NET code to create tmports ibex4 a PDF from an FO file Module Modulel Sub Main Dim doc As New FODocument doc generate manual fo manual pdf End Sub End Module Projects need to have a reference to the ibex DLL 5 2 1 Generating to File public void generate string fo_file_name string pdf_file_name This will read the FO contained in the file named in pdf_file_name and create the PDF file named in pdf_file_name 5 2 2 Generating using streams public void generate Stream fo_stream Stream pdf_stream public void generate Stream fo_stream Stream pdf_stream bool close_stream This will read the FO from the System 1O Stream called fo_stream and create the PDF file into the System lO Stream pdf_stream These streams can be anything derived from System IO Stream such as System 1O FileStream or System O MemoryStream If cl
72. svg gt lt rect x 1 y 1 width 1198 height 598 fill none stroke blue stroke width 1 gt lt path d M200 300 0400 50 600 300 T1000 300 fill none stroke red stroke width 5 gt lt End points gt lt g fill black gt lt circle cx 200 cy 300 r 10 gt lt circle cx 600 cy 300 r 10 gt lt circle cx 1000 cy 300 r 10 gt lt g gt lt Control points and lines from end points to control points gt lt g fill 888888 gt lt circle cx 400 cy 50 r 10 gt lt circle cx 800 cy 550 r 10 gt lt g gt lt path d M200 300 L400 50 L600 300 L800 550 L1000 300 fill none stroke 888888 stroke width 2 gt lt svg gt 110 Scalable Vector Graphics SVG images Ibex PDF Creator Developers Guide The curve looks like this a ae 17 4 10 1 Path line join shapes The shape where a path changes direction is set with the stroke linejoin attribute Possible values are Value Shape stroke linejoin miter _ stroke linejoin bevel stroke linejoin round es 17 4 11 lt style gt The lt style gt element is currently implemented to some extent in Net and not in Java In Net the class attribute can be used in conjunction with a style to apply that style to an element Additional CSS support is currently being added to both Java and Net Scalable Vector Graphics SVG images 111 Ibex PDF Creator Developers Guide 17
73. the page plus any margin on the simple page master element The inner edge of the region is the outer edge plus the value of the extent attribute Percentage values refer to the size of the page Default value opt Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points Elements and Attributes 333 20 17 69 Figure 25 73 Figure 25 74 25 11 70 Ibex PDF Creator Developers Guide external destination Description This attribute destination of a basic link element used to create a hyperlink in the document The format of the external destination attribute must be a URI specification RFC2396 as described below To link local file the format should be external destination url external pdf or to link to a website use a format like this external destination url http www xmlpdf com builds ibex pdf Default value Values lt uri specification gt A sequence of characters that is url followed by optional white space followed by an optional single quote or double quote character followed by a URI reference as defined in RFC2396 followed by an optional single quote or double quote character followed by optional white space followed by The two quote characters must be the same and must both be present or absent If the URI reference contains a single quote the two quote charac
74. the table The marker from the first row is shown in Figure 15 33 and the marker from the last row is shown in Figure 15 34 Figure 15 33 g 1533 lt table row gt FO for marker inthe lt marker marker class name continued gt first table row lt table row gt lt table cell gt lt block gt continued on next page lt block gt lt table cell gt lt table row gt lt marker gt lt table cell gt lt block gt row 1 cell 1 lt block gt lt table cell gt lt table row gt Figure 15 34 8 1734 lt table row gt FO for marker inthe lt marker marker class name continued gt last table row lt table cell gt lt block gt row last cell 1 lt block gt lt table cell gt lt table row gt 15 13 Aligning columns at the decimal point Ibex can align the contents of cells in a column on the decimal point by specifying text align on each fo table cell in the column This can be done explicity on each fo table cell or to make things easier to maintain it can be done by specifying text align on the fo table column and text align from table column on each fo table cell Example FO for aligning columns is shown in Figure 15 35 and the resulting output is shown in Figure 15 36 92 Tables Ibex PDF Creator Developers Guide Figure 15 35 co able font 10pt arial gt FO for decimal point lt table column column width 503 gt alignment lt table column column width 50 text align gt lt tabl
75. the use of the element see Figure 25 4 164 Elements and Attributes 25 1 12 Ibex PDF Creator Developers Guide simple page master Description This element defines the layout of a single page It is uniquely identified by its master name which is used on page sequence and other elements to create pages which use this layout The content of the page goes into the named regions which are specified by the child elements of this element The size of the page is defined using the page height and page width attributes The default page size is A4 Child element s This element can contain the following elements region after zero or one region before zero or one region body one or more region end zero or one region start zero or one Parent element s This element can be contained in the following elements layout master set Attributes The following attributes can be used on this element margin margin bottom margin left margin right margin top space before space after start indent end indent master name page height page width reference orientation writing mode For an example showing the use of the element see Figure 25 1 Elements and Attributes 165 25 1 13 Ibex PDF Creator Developers Guide region body Description This element defines the shape of the main area on the page into which content from flow elements will be placed The region has a default name of xsl region body which is u
76. top border style For example border top style solid Default value none Values lt border style gt Can be any of the values none No border solid A single solid line this is 1pt solid black double Two lines separated by a gap The gap is 1 3 of the width of the border this is 4pt black double dashed See example this is 2pt black dashed i bee d dotted See example F this is 2pt black dotted inset The top and left borders are slightly darker then the required color and the bottom and right borders are slightly lighter this is 2pt blue inset outset See example this is 2pt blue outset groove See example 322 Elements and Attributes Ibex PDF Creator Developers Guide ridge See example inherit 25 11 48 border top width Description Sets the top border width For example Figure 25 62 border top width 1pt Default value medium Values lt border width gt Can be any of the values thin A thin border The actual default width is Settings BorderWidthThin and so can be changed programatically medium A medium border The actual default width is Settings BorderWidthMedium and so can be changed programatically thick A thick border The actual default width is Settings BorderWidthThick and so can be changed programatically lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit 25 11 4
77. using the block element The simplest possible block is shown in Figure 9 1 Figure 9 1 l ock gt hello world lt block gt A simple block This creates a paragraph in the output document which has the default font which is helvetica and the default alignment which is left The sections below describe elements and attributes used to control the formatting of text 9 1 Using the font attribute The quickest way to get the font you require is to use the font attribute as shown in Figure 9 2 Figure 9 2 Using the font attribute lt block font bold 12pt garamond gt hello world lt block gt Using the font attribute is simpler than specifying all the individual attributes such as font weight and font size but does need some care When using the font attribute the order of the words is important The font style normal italic and the font weight bold normal must come before the font size The font name must come after the font size If the font name contains spaces it must be enclosed in quotes as shown in Figure 9 3 Figure 9 3 _ lt block font bold 12pt times new roman gt A font name with hello world spaces lt block gt The full syntax of the font attribute is shown in Figure 9 4 Figure 9 4 lt font style gt lt font variant gt lt font weight gt Syntax of font lt font size gt lt lineheight gt attribute lt font family gt Text Formatting 53 Ibex PDF Creator Dev
78. which appears between the border of an element and the content such as text of that element This sets the padding on the start edge of an element which for an non rotated area is the left edge padding start 1pt Default value opt Values inherit lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points padding top Description Padding is space which appears between the border of an element and the content such as text of that element This sets the padding on the top edge of an element padding top 1pt Default value opt Values inherit lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points 356 Elements and Attributes 25 11 115 25 11 116 25 11 117 Ibex PDF Creator Developers Guide page height Description This is used on a simple page master element to set the height of a page If not set or if set to auto the page height is determined from the Settings PageHeight property Default value auto Values auto lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points page width Description This is used on a simple page master element to set the width of a page If not set or if set to auto the page width i
79. width For an example showing the use of the element see 210 Elements and Attributes 20 3 7 Ibex PDF Creator Developers Guide inline container Description This element is used create an inline reference area Because it can contain block level elements it can be used to place a block level element such as a table into a line of text This can be used to horizontally center the block level element by centering the inline container which being an inline element can be centered using normal text alignment attributes Child element s This element can contain the following elements block zero or more block container zero or more float one or more cannot be used inside an out of line element index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element list block zero or more retrieve marker one or more subject to constraints specified for this element table zero or more table and caption zero or more wrapper one or more subject to constraints specified for this element Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title block inline folio suffix folio prefix Elements and Attributes 211 Ibex PDF Creator bidi override
80. 003 ibex Format gt ibex security element lt ibex security deny print true deny extract true deny modify true user password user owner password owner gt Two levels of encryption are available 40 bit and 128 bit When using 40 bit encryption available permissions which can be set including deny print deny extract and deny modify When using 128 bit encyption additional permissions can be set including deny assembly and deny print high resolution These options are details in the sections below The level of encryption is specified using the bits attribute of the ibex security element This defaults to 40 so specify 128 bit encryption specify bits 128 If used the ibex security element must occur before any page sequence elements Extensions 135 Ibex PDF Creator Developers Guide 22 1 1 40 bit encryption security options When the number of bits of encryption is set to 40 or not specified the attributes of the ibex security element are user password Specifies a password required to open the document in Acrobat Once the document is opened with the correct user password access is limited to permissions given using the attributes below owner password Specifies a password required to get all rights to the document in Acrobat Once the document is opened with the correct owner password the user has total control of the document deny print true If this is set to true a user who opens the false document wit
81. 01 350 250 277 301 303 215 231 161 321 161 gt lt polygon fill lime stroke blue stroke width 10 points 850 75 958 137 5 958 262 5 850 325 742 262 6 742 137 5 gt lt svg gt resulting in this image Scalable Vector Graphics SVG images 115 17 4 18 17 4 19 17 4 20 17 4 21 17 5 17 6 Ibex PDF Creator Developers Guide lt text gt The lt text gt element is supported lt tspan gt The lt tspan gt element is not implemented lt textpath gt The lt textpath gt element is not implemented lt pattern gt The lt pattern gt element is not implemented Opacity The attributes stroke opacity and fill opacity are supported Using the group opacity attribute to apply opacity to a group of elements is not supported instead the opacity value is applied as if stroke opacity and fill opacity has been specified This example shows a transparent blue rectangle drawn over an opaque red rectangle lt svg xmlns http www w3 org 2000 svg width 400 height 140 gt lt rect width 400 height 140 fill none stroke silver gt lt g transform translate 10 10 gt lt rect width 100 height 100 fill red gt lt g gt lt g transform translate 30 30 gt lt rect width 100 height 100 fill blue stroke width 1 fill opacity 0 3 gt lt g gt lt svg gt resulting in this image Markers Markers are supported at the start and end of lt line gt and l
82. 1 Figure 25 112 Ibex PDF Creator Developers Guide scaling Description This is used on graphic elements external graphic and instream foreign object to specify how the image should be scaled If the scaling is uniform a change to the image size using content height or content width will result in a corresponding change in the other dimension to preserve the aspect ratio If scaling is non uniform a change to height or width will not change the other dimension and the aspect ratio will be changed Default value uniform Values uniform See above non uniform See above space after Description This attribute is used to define the amount of space which appears between this element and the next This attribute can be set as a single value like this space after 3mm or individual components can be set like this space after minimum 3pt space after optimum 4pt space after maximum 5pt Space resolution in XSL FO is complicated If two elements have space after the first one and before the second one usually the space is combined using a formula so that generally speaking the largest space will be used For example if there are two blocks A and B and A has space after 3cm and B has space before 2cm the space between the blocks will not be the sum of the two spaces ie 5cm it will be the largest of the two ie 3cm 362 Elements and Attributes Figure 25 113 Figure 25 114 Figure 25 115 Fig
83. 1 1 now has this feature so the ibex bookmark element is no longer supported The XSL 1 1 implementation of bookmarks is described on page 129 22 6 Document base URL The PDF format supports setting a base URL for links created with a basic link element This base URL is prepended to the destination specified with an external destination attribute if and only if the specified destination does not start with a character Figure 22 4 shows FO which creates a document with http www xmlpdf com as the base URL and a link to the page index html When the user clicks on the link in the PDF file it will go to http www xmlpdf com index html Figure 22 4 lt ibex document base url value http www xmlpdf com gt FO setting the document base URL lt Plock gt lt basic link external destination url index html gt index html lt basic link gt lt block gt The base URL is a document wide property and can be set only once 140 Extensions Ibex PDF Creator Developers Guide This property should not be confused with the Settings BaseURI value which specifies a base URI to be used when Ibex retrieves images stylesheets and XML during creation of the PDF file 22 7 Ibex version The ibex version element inserts the version number of Ibex used to create the PDF file This is an inline element which inserts characters into the document Figure 22 5 shows FO which uses this element and the output appears i
84. 3pt If there are four values the top margin is set to the first value the right margin is set to the second the bottom is set to the third and the left is set to the forth so clockwise from the top like this margin l1pt 2pt 3pt 4pt Default value Shorthand properties do not have default values See individual properties for their default values Values inherit lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points Elements and Attributes 347 25 11 94 Figure 25 98 25 11 95 Figure 25 99 25 11 96 Ibex PDF Creator Developers Guide margin bottom Description Sets the bottom margin on an element For example margin bottom 1pt Default value opt Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit margin left Description Sets the left margin on an element For example margin left 1pt Default value opt Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit margin right Description Sets the right margin on an element For example 348 Elements and Attributes Figure 25 100 20 11 97 Figure 25 101 25 11 98 Ibex PDF Creator Developers Guide margi
85. 4 12 lt rect gt The lt rect gt element is supported A simple rectangle can be drawn like this lt svg xmlns http www w3 org 2000 svg width 400 height 120 gt lt rect x 10 y 10 width 100 height 100 fill none stroke red gt lt svg gt resulting in this image 17 4 13 lt circle gt The lt circle gt element is supported A simple circle can be drawn like this lt svg xmlns http www w3 org 2000 svg width 400 height 120 gt lt circle cx 50 cy 50 r 30 fill none stroke red gt lt svg gt resulting in this image 112 Scalable Vector Graphics SVG images Ibex PDF Creator Developers Guide 17 4 14 lt ellipse gt The lt ellipse gt element is supported A simple ellipse can be drawn like this lt svg xmlns http www w3 org 2000 svg width 400 height 200 gt lt ellipse cx 100 cy 100 rx 75 ry 50 fill none stroke black gt lt svg gt resulting in this image Scalable Vector Graphics SVG images 113 17 4 15 17 4 15 1 17 4 15 2 Ibex PDF Creator Developers Guide lt line gt The lt line gt element is supported A simple line can be drawn like this lt svg xmlns http www w3 org 2000 svg width 400 height 400 gt lt line x1 10 yl 10 x2 100 y2 10 stroke blue stroke width 4 gt lt svg gt resulting in this image Line end shapes The shape of the end of a line is set with the stroke linecap attribute Possible v
86. 9 border width Description Sets the border width for all four sides of an element to the same width or to a number of different widths Elements and Attributes 323 Figure 25 63 Figure 25 64 Figure 25 65 Figure 25 66 Ibex PDF Creator Developers Guide To set all borders to the same width use a single value like this border width l1pt If there are two values the top and bottom borders are set to the first value and the side borders are set to the second like this border width l1pt 3pt If there are three values the top border is set to the first value the side borders are set to the second and the bottom is set to the third like this border width 1pt 2pt 3pt If there are four values the top border is set to the first value the right border is set to the second the bottom is set to the third and the left is set to the forth so clockwise from the top like this border width l1pt 2pt 3pt 4pt Default value Shorthand properties do not have default values See individual properties for their default values Values lt border width gt Can be any of the values thin A thin border The actual default width is Settings BorderWidthThin and so can be changed programatically medium A medium border The actual default width is Settings BorderWidthMedium and so can be changed programatically thick A thick border The actual default width is Settings BorderWidthThick and so can be changed programati
87. Attributes The following attributes can be used on this element internal destination starting state For an example showing the use of the element see Figure 25 18 Elements and Attributes 265 Ibex PDF Creator Developers Guide 25 7 3 bookmark title Description This element holds the text for a bookmark entry Parent element s This element can be contained in the following elements bookmark For an example showing the use of the element see Figure 25 18 266 Elements and Attributes Ibex PDF Creator Developers Guide 25 8 Out of line formatting objects The objects described in this section are used to create floats and footnotes Elements and Attributes 267 25 8 1 Ibex PDF Creator Developers Guide float Description This element is used to position content either a at the top of a page or b to the side of a page so that text flows around it Child element s This element can contain the following elements block zero or more block container zero or more float one or more cannot be used inside an out of line element index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element list block zero or more retrieve marker one or more subject to constraints specified for this element table zero or more table and caption zero or more wrapper one or more subject to constraints s
88. Creator Developers Guide This sets the padding on the after edge of an element which for an non rotated area is the bottom edge padding after l1pt Default value opt Values inherit lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points padding before Description Padding is space which appears between the border of an element and the content such as text of that element This sets the padding on the before edge of an element which for an non rotated area is the top edge padding before 1pt Default value opt Values inherit lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points Elements and Attributes 353 25 11 109 Figure 25 105 25 11 110 Figure 25 106 Ibex PDF Creator Developers Guide padding bottom Description Padding is space which appears between the border of an element and the content such as text of that element This sets the padding on the bottom edge of an element padding bottom 1pt Default value opt Values inherit lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points padding end Description Padding is space which appears between the border of an element and the content such a
89. Each child of this element specifies a sequence of one or more pages A single page master reference element is used define the layout for one page A repeatable page master reference element is used define multiple pages which have the same layout because they use the same page master A repeatable page master alternatives element is used define multiple pages which can have different layouts created using different page master elements Child element s This element can contain the following elements repeatable page master alternatives zero or more repeatable page master reference zero or more single page master reference zero or more Parent element s This element can be contained in the following elements layout master set Attributes The following attributes can be used on this element master name For an example showing the use of the element see Figure 25 3 Elements and Attributes 159 Ibex PDF Creator Figure 25 3 8 53 lt xml version 1 0 encoding UTF 8 gt Using lt root xmlns http www w3 org 1999 XSL Format gt page sequence lt layout master set gt lt simple page master master name simple gt master lt region body margin 2 5cm region name body background color eeeeee gt lt simple page master gt lt page sequence master master name repeated gt lt repeatable page master reference master reference simple gt lt page sequence master gt lt layout master set gt
90. Figure 16 8 Figure 16 8 Right aligned image If we specify text align center and display align center the image will move to the horizontal and vertical center of the inline area as shown in Figure 16 9 Figure 16 9 Vertically and horizontally centered image 16 4 1 Leading Looking at the image in Figure 16 10 you can see a gap between the top of the image and the border This is the leading which appears because the image is treated as a text element and sits on the baseline The amount of leading is derived from the font size so you can reduce it to zero by setting the font size to zero by specifying font size 0pt on the containing block element This has been done in Figure 16 11 Figure 16 10 Image with leading above it Images 99 Ibex PDF Creator Developers Guide Figure 16 11 Using with leading removed 16 5 Image resolution The resolution of an image in dots per inch dpi can be set using the dpi attribute on the external graphic element Setting this attribute overrides the dpi value read from the image file Setting the dpi to a lower value than the one specified in the image will result in smaller image of lower quality than the original This is often done to reduce the size of the image in the PDF file and can result in massive decreases in PDF file size If you have an image which is stored at 2400 dpi and your end user will display it on a 96 dpi screen or print it on 600 dpi prin
91. Ibex PDF Creator NET Programmers Guide For Ibex version 4 7 7 6 Table of Contents Te MATFOOUCION sinehan a E covdviaa 1 2zlnstallatior amenena aa a a A 5 3 Getting Started with Ibex sssssssssnssssesssesirssnessstssnresrensntssnnenensntennrennnnnennrnnrnnnnne 7 4 Introduction to XSL FO sss sssssssnsssisssressnsssiesstesrnnstesntesrnnntesntennnnnntenntennnnnntnntenaa 11 5 USING DEX ucena ne TD i E SAN ata essen 29 Gs Using bec wih ASR NE T f rr ra a araara E aiea sus lnsetbateustieetlelegedess 33 7 Error Handling amp Logging s sessssssssisssnsssressressressressressnessrennrrennensnennnrsnrennrennnrns 39 a AS AOU ieee ate a O a nace ean dled 43 9 Text Formatting asesinan a a ae a a 53 TOL FONTS ereire a a Mua a a ar a cele Ad e 65 Wels Foals osiad na aa n he ina dot tect nites adhe a TAE 67 12 Space Handling shan desta eid ad ana dnar iod nder eiee aia hue oian Aintzas 69 T3 Colors a a r r a E ER 73 UA SVS ES i e e a e aie E a EE E T N A E E 77 Ds eol AAN EE A A ET 81 1s Images oiee e are Sean ane E E 95 17 Scalable Vector Graphics SVG images oo ee teee ee eeeeteeeeeeteeees 107 18 Absolute Positioning ssidnsreinidcnainueeimladunlanabaaainen 123 ASE Columns e e a a a a a aA 127 20 BOOKMaArKS terena e daccea vee teh ctt tau ttt tec eneue ee sare 129 21 Config ratiom spinii er ier tats a aaa dan tesg thee eaten a tas aaa 131 22 EXtENSIONS x ete ei aa eae RN adh A Lahn starlet AS 135 Oe RDRA A arnee aee er
92. O to increase the letter spacing of some text The resulting text is shown in Figure 9 19 Figure 9 18 4 _ lt block letter spacing 0 2em gt WELLINGTON NEW ZEALAND lt block gt Using letter spacing Figure 9 19 Text formatted using WELLINGTON NEW ZEALAND letter spacing It is possible to make letters closer than normal using a negative value for letter spacing Example FO for this is shown in Figure 9 20 and the result in Figure 9 21 Figure 9 20 Moving letters closer together Figure 9 21 Text a n WELL INGTON NEW ZEALAND letter spacing lt block letter spacing 0 1em gt WELLINGTON NEW ZEALAND lt block gt 9 11 Spacing before and after words Spacing before and after text is specified using the space start and space end attributes on the inline element The space start attribute specifies space to appear before text space end specifies space to appear after the text Figure 9 22 shows how to specify a gap between two words This FO produces a 3cm gap between the words as shown in Figure 9 23 Figure 9 22 lt block gt Using space start hello lt inline space start 3cm gt world lt inline gt lt block gt Figure 9 23 Output using hello world space start Space between words is collapsed i e merged by default If a word has space end 1 0cm and the following word has space start 0 5cm the gap between Text Formatting 59 Ibex PDF Creator Developers Guide the two words will be the larger
93. ables 230 Elements and Attributes 25 4 1 Ibex PDF Creator Developers Guide table and caption Description This element is used to create a table which has a caption above or below it and to keep the table and caption together By default the caption appears above the table Set caption side bottom to make the caption appear below the table Child element s This element can contain the following elements table zero or more table caption zero or one Parent element s This element can be contained in the following elements wrapper basic link float footnote body static content table caption block block container inline inline container bidi override table cell list item label list item body marker Attributes The following attributes can be used on this element background attachment background color Elements and Attributes 231 Ibex PDF Creator background image background position horizontal border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left margin margin bottom margin left space after end indent bottom right break after caption side id index key keep together keep with previous 232 Elements and
94. adding before padding start padding top padding left margin margin left margin top space after end indent column count display align region name writing mode Developers Guide border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right margin bottom margin right space before start indent clip column gap overflow reference orientation For an example showing the use of the element see Figure 25 5 Figure 25 5 8 53 lt simple page master master name front page margin 1 5cm Using regions page height 297mm page width 210mm gt lt region body region name body margin 0 75cm 0 5cm 0 75cm 3cm gt lt region before region name header extent 2 5cm gt lt region after region name footer extent 1cm gt lt region start extent lcm background color eeeeee gt lt region end extent lcm background color eeeeee gt lt simple page master gt Elements and Attributes 167 25 1 14 Ibex PDF Creator Developers Guide region before Description This element defines the shape of a region which is at the top of a non rotated page Content from static content elements whose flow name matches the region name will be placed in this region The region has a default name of xsl region before which is usually changed to something simpler such as header using the region
95. ae e a e see beable 143 24 Using Ibex with Visual Basic and ASP ounces eetetetteteeeeeeeeee 147 25 Elements and Attributes ooo eeccecececceeccseeseceeeeeeeeeeeseeeseeeeseeeseseeeaneeeeeseeeeeeess 151 Table of Contents 26 Compliance with the XSL FO standard 2002 2010 Visual Programming Limited All rights reserved NOTICE All information contained herein is the property of Visual Programming Limited No part of this publication whether in hardcopy or electronic form may be reproduced or transmitted in any form or by any means electronic mechanical photocopying recording or otherwise without the prior written consent of the publisher PostScript is a registered trademark of Adobe Systems Incorporated Adobe the Adobe logo Acrobat the Acrobat logo Adobe Garamond Aldus Distiller Extreme FrameMaker Illustrator InDesign Minion Myriad PageMaker Photoshop Poetica and PostScript are trademarks of Adobe Systems Incorporated Apple Mac Macintosh QuickDraw and TrueType are trademarks of Apple Computer Inc registered in the United States and other countries ITC Zapf Dingbats is a registered trademark of International Typeface Corporation Helvetica and Times are registered trademarks of Linotype Hell AG and or its subsidiaries Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and or other countries Times New Roman is a trademark of The Monotype Corpora
96. alues are Value Shape stroke linecap butt stroke linecap round stroke linecap square The end of the line is the same shape as the default stroke linecap butt but projects further beyond the end coordinate Dashed lines Dashed lines are supported using the stroke dasharray attribute A dashed line can be drawn like this lt svg xmlns http www w3 org 2000 svg width 400 height 400 gt lt line x1 10 yl 10 x2 100 y2 10 stroke blue stroke width 4 stroke dasharray 3 2 gt lt svg gt resulting in this image 114 Scalable Vector Graphics SVG images Ibex PDF Creator Developers Guide 17 4 16 lt polyline gt The lt polyline gt element is supported A simple polyline can be drawn like this lt svg xmlns http www w3 org 2000 svg width 12cm height 4cm viewBox 0 0 1200 400 gt lt polyline fill none stroke blue stroke width 10 points 50 375 150 375 150 325 250 325 250 375 350 375 350 250 450 250 450 375 550 375 550 175 650 175 650 375 750 375 750 100 850 100 850 375 950 375 950 25 1050 25 1050 375 1150 375 gt lt svg gt resulting in this image 17 4 17 lt polygon gt The lt polygon gt element is supported A simple polygon can be drawn like this lt svg xmlns http www w3 org 2000 svg width 12cm height 4cm viewBox 0 0 1200 400 gt lt polygon fill red stroke blue stroke width 10 points 350 75 379 161 469 161 397 215 423 3
97. ample this manual has a different page master for the front cover and for the pages in the table of contents The page masters for this are shown in Figure 8 5 Figure 8 5 Two page masters lt layout master set gt lt simple page master master name front page margin 1 5cm page height 297mm page width 210mm gt lt region body region name body margin 0 75cm 0 5cm 0 75cm 3cm gt lt region before region name header extent 2 5cm gt lt region after region name footer extent 1cm gt lt region start extent l1cm background color eeeeee gt lt simple page master gt lt simple page master master name toc page margin 1 5cm gt lt region body column count 1 region name body margin 0 75cm 0 5cm 1cm 3cm margin left 2cm margin right 1 5cm gt lt region before region name header extent 1cem gt lt region after region name footer extent 0 75cm gt lt region start extent 2cm gt lt region end region name end extent 1 5cm gt lt simple page master gt lt layout master set gt Content is allocated to the two sections of the document using two separate page sequences as shown in Figure 8 6 Figure 8 6 lt page sequence master reference front page gt Allocating content to lt flow flow name body gt two page masters lt block gt content that appears in the body of the front page lt block gt lt flow gt lt page sequence gt lt page sequence mas
98. an be changed programatically A length such as 1ocm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points Can be any of the values none solid double dashed dotted inset outset groove ridge No border A single solid line this is 1pt solid black Two lines separated by a gap The gap is 1 3 of the width of the border this is 4pt black double See example this is 2pt black dotted The top and left borders are slightly darker then the required color and the bottom and right borders are slightly lighter this is 2pt blue inset See example this is 2pt blue outset See example See example Sets the after border color which for a non rotated object is the bottom one For example border after color red Elements and Attributes 297 25i Figure 25 24 Ibex PDF Creator Developers Guide Default value the value of the color property Values lt color gt A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color inherit border after style Description Sets the after border style which for a non rotated object is the bottom one For example border after style solid Default value none Values lt border style gt Can be any of the values none No border solid A single solid line this is 1pt solid black double Two lines separated by a
99. an be used on this element marker class name For an example showing the use of the element see Elements and Attributes 287 25 10 5 Ibex PDF Creator Developers Guide retrieve marker Description The marker element contains some content which will be retrieved elsewhere in the document using a retrieve marker element Typically marker is used to set some piece of text such as the current chapter title which is then retrieved within a static content element for placing in the page header The Ibex manual uses this technique to place the current chapter subject in the footer The marker element cannot be used in static content elements and the retrieve maker element can be used only in static content elements An marker uses the marker class name attribute to group markers which have a common purpose The retrieve marker element has some attributes to specify which marker should be retrieved such as the first or last one in the document or the first or last one on that page For the retrieve marker element to work its retrieve class name attribute must have the same value as the maker class name attribute used on some marker element Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix
100. an image or to load an image from a database for inclusion in the PDF file The image must be passed to Ibex in a byte array or a Stream from the System IO namespace The image must be given a unique identifier by which it can be retrieved during the PDF creation process This is done using the addNamedimage method on the FODocument object This method takes two parameters 1 a string which identifies the image and 2 the stream or array which contains the image itself For example if we had an image in a byte array called image and we wanted to give it the identifier 1029 we would use the code shown in Figure 16 15 to do this Figure 16 15 byte image dynamically create C code to load an image from memory FODocument document new FODocument document addNamedImage 1029 image This must be done before calling generate to create the PDF file Within the FO file the image is retrieved from memory using the syntax shown in Figure 16 16 Figure 16 16 lt external graphic src url data application ibex image 1029 gt FO to load an image from memory i ey The value of the src attribute must be the string url data application ibex image followed by the unique identifier which was passed to addNamedimage This syntax for the url attribute conforms to RFC 2397 The data URL scheme which can be found at http www fags org rfcs rfc2397 html Images 101 Ibex PDF Creator Deve
101. ariant margin margin bottom margin left bottom right alignment adjust baseline shift id index key keep with previous line height text altitude Developers Guide border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right font selection strategy font stretch font style font weight margin top margin right relative position top left alignment baseline dominant baseline index class keep with next letter spacing score spaces text decoration Elements and Attributes 217 Ibex PDF Creator Developers Guide text depth text shadow text transform visibility word spacing wrap option For an example showing the use of the element see 218 Elements and Attributes 25 3 10 Ibex PDF Creator Developers Guide page number citation Description This element is used to insert the first page number on which the content created by some other element occurs The page number string is formatted using the string conversion properties of the containing page sequence namely format grouping separator grouping size letter value country and language The page number citation has a ref id attribute which should match the id attribute of the element whose page number we want to appear Chil
102. as not to overlap the side regions See the following page for an example where the precedence attribute is used to change this lt simple page master master name region example 1 gt lt region body margin 2 5cm region name body background color eeeeee gt lt region before extent 2 5cm region name header background color dddddd gt lt region after extent 2 5cm region name footer background color dddddd gt lt region start extent 2 5cm region name SsStart background color aaaaaa gt lt region end extent 2 5cm region name end background color aaaaaa gt lt simple page master gt region after Layout examples 49 region before region example 1 margins region body his page layout is created with the XML below Note that by default the region start and region end regions extend he full height of the page and the region before and region after regions are narrowed so as not to overlap the ide regions See the following page for an example where he precedence attribute is used to change this his layout differs from the previous page in that the imple page master has the margin attribute set to 2 5cm This creates a margin of 2 5cm around the entire page and regions are positioned with respect to the rectangle created by the margins not with respect to the edges of the paper lt simple page master master name region example 1M margin 2 5cm gt
103. attribute matches a region name defined in the current page sequence will appear This is how we produce different formats for odd and even pages Figure 8 4 shows in matching colors the attributes which should match for content to appear Figure 8 4 lt root xmlns http www w3 org 1999 XSL Format gt Matching flow and lt layout master set gt region names lt simple page master master name front page gt lt region body margin right 2 5cm margin left 4cm margin bottom 4cm margin top 4cm region name body gt lt region after extent 3cm region name footer gt lt simple page master gt lt layout master set gt lt page sequence master reference front page gt lt flow flow name body gt 44 Page Layout Ibex PDF Creator Developers Guide lt block gt Hello World lt block gt lt flow gt lt page sequence gt lt root gt 8 2 Using different layouts for different pages It is possible to define different page layouts for different pages This can be done in two possible ways either by assigning different page masters to different page sequences or by using a page master alternatives element which chooses from a set of simple page master elements based on criteria such as the current page number 8 2 1 Using different page masters for each page sequence Using a different page master for each page sequence is useful when you can clearly divide the document into distinct sections For ex
104. background position horizontal background position vertical border border before color border before style border before width border after color border after style border after width border start color border start style border start width border end color border end style border end width border top border top color border top style border top width border bottom border bottom color border bottom style border bottom width border left border left color border left style Elements and Attributes 241 Ibex PDF Creator border left width border right color border right width margin top margin right space before start indent relative position top left border before precedence border end precedence index class visibility Notes on attributes Developers Guide border right border right style margin margin bottom margin left space after end indent bottom right border after precedence border start precedence id index key As described in section 6 7 6 of the XSL FO specification only the background properties from this set apply If the value of border collapse on the table is collapse or collapse with precedence the border properties also apply 242 Elements and Attributes 25 4 6 Ibex PDF Creator Developers Guide table footer Description This element creates a footer which appears once at the bottom of the table and also before each page break To prevent this repetition set table omit footer at
105. be contained in the following elements Attributes The following attributes can be used on this element background attachment background image background position horizontal border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width 200 Elements and Attributes background color background repeat background position vertical border before color border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding Ibex PDF Creator padding before padding start padding top padding left font family font size font size adjust font variant margin margin bottom margin left bottom right color line height text decoration text transform Developers Guide padding after padding end padding bottom padding right font selection strategy font stretch font style font weight margin top margin right relative position top left letter spacing score spaces text shadow word spacing For an example showing the use of the element see Elements and Attributes 201 25 3 4 Ibex PDF Creator Developers Guide external graphic Descriptio
106. ber suffix wrapper basic link title float footnote body static content table caption block block container inline folio suffix folio prefix inline container bidi override table cell list item label Elements and Attributes 277 Ibex PDF Creator list item body marker Attributes The following attributes can be used on this element ref id 278 Elements and Attributes Developers Guide Ibex PDF Creator Developers Guide 25 9 5 index key reference Description This element is used in the index creation process to insert a set of page numbers for all occurrences of the specified index key The child index page number prefix and index page number suffix elements specify content which will appear before and after the page numbers This is how you would create page numbers like 20 Child element s This element can contain the following elements index page number prefix zero or one index page number suffix zero or one Parent element s This element can be contained in the following elements index page citation list Attributes The following attributes can be used on this element page number treatment ref index key Elements and Attributes 279 25 9 6 Ibex PDF Creator Developers Guide index page citation list Description This element is used in the index creation process to group set of page numbers in the index Child element s This element can contain the following elements
107. ble zero or more table and caption zero or more wrapper one or more subject to constraints specified for this element Parent element s This element can be contained in the following elements list item Attributes The following attributes can be used on this element id index class index key keep together 258 Elements and Attributes Ibex PDF Creator Developers Guide For an example showing the use of the element see Elements and Attributes 259 Ibex PDF Creator Developers Guide 25 6 Dynamic effects link and multi formatting objects The objects described in this section are used to create links and dynamic content As most of the elements in this section relate to dynamic content which is not applicable to PDF only basic link is implemented 260 Elements and Attributes 25 6 1 Ibex PDF Creator Developers Guide basic link Description This element is used to create a link in the PDF document either to an external URL or to another location in the document Child element s This element can contain the following elements text basic link zero or more bidi override zero or more block zero or more block container zero or more character zero or more external graphic zero or more float one or more cannot be used inside an out of line element footnote one or more cannot be used inside an out of line element index page citation last zero or more index range begin one or more s
108. border right width padding before padding start padding top padding left relative position top left margin top margin right space before start indent break after id index key keep together keep with previous Developers Guide padding padding after padding end padding bottom padding right bottom right margin margin bottom margin left space after end indent break before index class intrusion displace keep with next relative align For an example showing the use of the element see 256 Elements and Attributes 25 5 3 Ibex PDF Creator Developers Guide list item body Description This element contains the body part of a list item The list item body contains block level elements it does not itself contain text Child element s This element can contain the following elements block zero or more block container zero or more float one or more cannot be used inside an out of line element index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element list block zero or more retrieve marker one or more subject to constraints specified for this element table zero or more table and caption zero or more wrapper one or more subject to constraints specified for this element Parent element s This element can be contained in the following elements list item Attributes The followi
109. bottom of the table before each page break This is the default To prevent the table footer appearing on pages other than the last specify table omit footer at break true on the table element 15 11 Behavior at page breaks 15 11 1 Repeating headers Table headers are repeated at the top of the table after each page break This is the default To prevent the table header appearing on pages after the first specify table omit header at break true on the table element 90 Tables Ibex PDF Creator Developers Guide 15 11 2 Repeating footers Table footers are repeated at the bottom of the table before each page break This is the default To prevent the table footer appearing on pages other than the last specify table omit footer at break true on the table element 15 11 3 Repeating table borders Table borders by default do not repeat at a break in the table so the top border of a table is rendered only on the first page the table is on and the bottom border is rendered only on the last page To make the table bottom border repeat at each page break it is necessary to specify border after width conditionality retain on the table element To make the table top border repeat at each page break it is necessary to specify border before width conditionality retain on the table element 15 12 Table continuation markers Table continuation markers provide a way of dynamically changing the header and footer on a tabl
110. cally lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points transparent inherit 324 Elements and Attributes 25 11 50 25 1151 25 11 52 Ibex PDF Creator Developers Guide bottom Description This is used for absolutely and relatively positioned elements only It sets the distance from the bottom edge of the containing element to the bottom edge of this element Default value auto break after Description Use this element to insert a page break after this element Default value auto Values auto column page A page break will occur after this element inherit break before Description Use this element to insert a page break before this element Default value auto Values auto column page A page break will occur before this element inherit Elements and Attributes 325 Ibex PDF Creator Developers Guide 25 11 53 caption side Description This is used on a table and caption to specify on which side of the table the caption appears Default value before Values before after start end top bottom left right inherit 25 11 54 character Description This attribute sets the character to be inserted by a character element For instance to insert the character A into the content you would use an character element like this Figure 25 67 lt character character A gt
111. cells and table elements are collapsed into a single border or remain separate Default value collapse Values collapse collapse with precedence separate inherit borders are collapsed Precedence rules are evaluated to see which borders take precedence borders are collapsed Precedence rules are evaluated to see which borders take precedence In addition the border precedence attribute can be used to change the precedence rules borders are not collapsed Only cell and table borders are considered borders on all other elements are ignored Elements and Attributes 305 25 1127 Figure 25 33 Figure 25 34 Figure 25 35 Figure 25 36 Ibex PDF Creator Developers Guide border color Description Sets the border color for all four sides of an element to the same color or to a number of different colors To set all borders to the same color use a single value like this border color red If there are two values the top and bottom borders are set to the first value and the side borders are set to the second like this border color red blue If there are three values the top border is set to the first value the side borders are set to the second and the bottom is set to the third like this border color red blue green If there are four values the top border is set to the first value the right border is set to the second the bottom is set to the third and the left is set to the forth so
112. ch will become the identifier OutputConditionldentifier value in the first Outputintents array entry This defaults to Custom PDF X 143 Ibex PDF Creator Developers Guide output condition Optional text which will become the OutputCondition value in the first Outputintents array entry This defaults to Custom Acrobat proposes values such as TRoo1 SWOP CGATS The color profiles is read from the specified ICC file compressed and embedded in the PDF file 23 1 Media box The MediaBox size within the PDF file will be set to the size of the page as specified on the simple page master for that page 23 2 Bleed box The BleedBox size defaults to the MediaBox size The BleedBox can be specified as a change from the MediaBox by specifying the ibex bleed width attribute on the simple page master This attribute specifies the distance by which the BleedBox is smaller than the MediaBox as shown in Figure 23 2 Figure 23 2 x lt simple page master page height 313mm page width 22 6mm Setting the bleed box master name page ibex bleed width 3mm gt size If one value is used it applies to all sides of the page if two values are used the top and bottom edges use the first value and the left and right edges use the second If there are three values the top is set to the first value the sides are set to the second value and the bottom is set to the third value If there are four values they apply to the top right b
113. ckground color eeeeee gt lt region after extent lcm region name footer background color dddddd gt lt region start extent 2 5cm gt lt region end extent 2 5cm gt lt simple page master gt lt layout master set gt lt page sequence master reference simple gt lt static content flow name footer gt lt block text align center gt XSL FO Example page lt page number gt of lt page number citation ref id last page gt lt block gt lt static content gt lt flow flow name body gt lt block gt Hello World lt block gt lt block id last page gt lt flow gt lt page sequence gt lt root gt This FO produces the page shown in Figure 4 27 Figure 4 27 Page with page number and total page count Hello World XSL FO Example page 1 of 1 4 7 Adding text content Text is added to the body region of the page by using the block element A block element can contain any amount of text and has attributes which define how the text will appear These attributes are described in more detail later in the manual 22 Introduction to XSL FO Ibex PDF Creator Developers Guide A block can contain text as shown in Figure 4 28 Figure 4 28 j lt flow flow name body gt Textinablock lt plock gt Hello World lt block gt lt flow gt A block element can also contain other block elements which in turn contain text or more nested elements Figure 4 29 shows a block which contain
114. cks when used on block container and table elements Rotation is counter clockwise 358 Elements and Attributes 25 11 121 25 11 122 Ibex PDF Creator Developers Guide See block container for an example Default value Values 90 180 270 90 180 270 inherit ref id Description This attribute is used on the page number citation to identify which the element for which we want to retrieve the page number This should match the value of the id attribute on the other element See page number citation for an example Default value This attribute has no default value you must provide a value region name reference Description This is used on a region name specifier to specify the name of a region which will have flows mapped onto it by the containing flow map Default value none a value is required Elements and Attributes 359 25 11 123 25 11 124 25 11 125 Ibex PDF Creator Developers Guide retrieve boundary Description This attribute is used on a retrieve marker to specify limits on which markers should be retrieved See marker for a complete example Default value page sequence Values page page sequence document retrieve class name Description This attribute is used on a retrieve marker to specify which marker is to be retrieved This attribute specifies which class of marker is retrieved and the retrieve boundary and retrieve position attributes are used to ch
115. cm gt A2 lt block gt lt block gt lt block space before 1cm gt B lt block gt so the space between A and B will be 4cm because this is the largest value If B had a child block this would also be considered And it gets worse In the example shown above A2 makes the last mark on the page made by the A block and its children If A had a bottom border this border would then be the last mark made by the A block and its children because the border of A is after Elements and Attributes 363 25 11 130 Figure 25 117 Figure 25 118 Ibex PDF Creator Developers Guide A2 and the merging formula would not consider A2 as it does not now make the last mark and so the gap between A and B would now be 3cm Default value opt Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points space before Description This attribute is used to define the amount of space which appears between this element and the previous one This attribute can be set as a single value like this space before 3mm or individual components can be set like this space before minimum 3pt space before optimum 4pt space before maximum 5pt Space resolution in XSL FO is complicated See space after for a detailed description of space resolution Default value opt Values lt length gt A length such as 10cm Valid units a
116. cm region name body background color eeeeee gt lt region after extent lcm region name footer background color dddddd gt lt region start extent 2 5cm gt lt region end extent 2 5cm gt lt simple page master gt lt layout master set gt lt page sequence master reference simple gt lt static content flow name footer gt lt block text align center gt XSL FO Example lt block gt lt static content gt lt flow flow name body gt lt block gt Hello World lt block gt lt flow gt lt page sequence gt lt root gt Note that the order of the static content and flow elements is important All static content elements must come before any flow elements This FO produces the page shown in Figure 4 21 Figure 4 21 FO with static content Hello World XSL FO Example Note that the flow name of the static content element and the region name of the region after element must match for the content to appear This feature makes it Introduction to XSL FO 19 Ibex PDF Creator Developers Guide possible to have many static content elements within the same page sequence and only those which match regions in the current simple page master will be rendered The Ibex manual has three different page layouts defined with three different simple page master elements Each simple page master has a footer region with a different region name The main flow element contains three different static con
117. d stream it back to a client browser without needing to save it to disk Ibex creates a PDF file into a Stream object from the System IO namespace In this example we use a MemoryStream object which derives from Stream and is basically an expandable array of bytes held in memory Creating the PDF file in a MemoryStream means the file is not saved to disk and the whole process occurs in memory We create the file into a MemoryStream because many versions of Internet Explorer will display a PDF file correctly only if they know how long the file is We need to create the PDF file into a MemoryStream to determine its length and set this length in an HTTP header This need to know the length of the PDF file prevents us from streaming directly to the Response object 6 1 The ASP page This example uses a page called pdfasp aspx which has code behind it in pdfasp aspx cs To use these pages you will need to create a new ASP NET C project add a reference to the ibex20 dll wherever you have installed it and then add the pdfgen aspx page You will need to remove the _ characters from the names of the pdfasp aspx and pdfasp aspx cs files The content of the ASP page pdfasp aspx is shown in Figure 6 1 Figure 6 1 lt Page language c validateRequest false Codebehind pdfasp aspx cs The ASP page autoEventWireup false Inherits WebApplicationl pdfasp gt lt DOCTYPE HTML PUBLIC W3C DTD HTML 4 0 Transitional EN gt lt HTML g
118. d add more content to the first body we can see that the content is constrained to the column If we add content to the first list item body as shown in Figure 4 36 we get the list shown in Figure 4 37 Figure 4 36 f lt list item body start indent body start gt FO for the list block lt piock gt If your Network Administrator has enabled it Microsoft Windows can examine your network and automatically discover network connection settings lt block gt lt list item body gt Figure 4 37 Output for the list block If your Network Administrator has enabled it Microsoft Windows can examine your network and automatically discover network connection settings this is item two For more information on lists see page 77 4 10 Creating tables A table is created using the table element Within the table element there can be one table header element any number of table body elements which contain the rows and one table footer element Each of the table header table body and table footer Introduction to XSL FO 25 Ibex PDF Creator Developers Guide elements contains one or more table row elements each containing one or more table cell elements which in turn contain block level elements such as block table and list block Since a table cell can contain any block level element you can easily create tables which contain text nested tables or lists Table headers and footers defined with the table header
119. d element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title block inline folio suffix folio prefix bidi override marker Attributes The following attributes can be used on this element background attachment background color background image background repeat Elements and Attributes 219 Ibex PDF Creator background position horizontal border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left font family font size font size adjust font variant margin margin bottom margin left bottom right alignment adjust baseline shift id index key keep with previous 220 Elements and Attributes Developers Guide background position vertical border before color border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding
120. d image background repeat background position horizontal background position vertical border border before color border before style border before width border after color border after style border after width border start color border start style border start width border end color border end style border end width border top border top color border top style 174 Elements and Attributes Ibex PDF Creator border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left clip extent region name writing mode Developers Guide border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right display align overflow reference orientation For an example showing the use of the element see Figure 25 5 Elements and Attributes 175 25 1 18 Ibex PDF Creator Developers Guide flow Description This element contains block level objects which create content which will appear in the body region of the page The flow name attribute must correspond to a region name used on the body region of the current page master for the content to be output Which page master this is is determined by the master reference attribute of the containing page sequence If the flow name does not match the region name the co
121. der bottom style border left border left style border right border right style relative position top left border before precedence border end precedence break before index key height keep with next visibility 248 Elements and Attributes Developers Guide border top style border bottom border bottom style border left border left style border right border right style border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width bottom right border after precedence border start precedence break after id index class keep together keep with previous 25 4 9 Ibex PDF Creator Developers Guide table cell Description This element is a container for content in a cell within a table Cell content is contained in block level elements within the cell A common error is to place text directly within the table cell element which results in the text being discarded A table cell element can contain any number of block level elements Contents of a cell are aligned vertically using the display align attribute To have a cell span mutiple columns use the number columns spanned attribute To span multiple rows use the number rows spanned attribute Child element s This element can contain the following
122. ders are not merged A gap can be inserted between adjacent borders using the border spacing attribute The border spacing attribute can have one or two values If one value is specified for instance border spacing 1mm the vertical and horizontal spacing between cells is set to this value If two values are specified separated by a space for instance border spacing 1mm 3mm the horizontal separation is set to the first value and the vertical separation is set to the second This is called the separated border model The following examples use a table with one row containing two cells The first cell has a bottom border the second does not The table also has a bottom border In the separate border model the border from the first cell will be drawn before the border of the table as shown in Figure 15 22 Tables 87 Ibex PDF Creator Developers Guide Figure 15 22 Cells with separate this cell has this cell does borders a bottom not have a bottom border border In the collapsed border model the border from the first cell will be merged with the border of the table and a single border will be drawn as shown in Figure 15 23 Figure 15 23 Cell border collapsed this cell has this cell does BOE iG Ish bott with table border aiken ee EA AEN E as border border If we add an inner border to each cell we can see this with the separate model as shown in Figure 15 24 Figure 15 24 Separate cell and this cell has this cell does tab
123. di override marker Attributes Developers Guide The following attributes can be used on this element background attachment background image background position horizontal border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left relative position top left background color background repeat background position vertical border before color border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right bottom right margin Elements and Attributes 203 Ibex PDF Creator margin top margin right space before start indent alignment adjust allowed height scale baseline shift clip content height display align height index class inline progression dimension keep with previous overflow scaling method text align Developers Guide margin bottom margin left space after end indent alignment baseline allowed width scale block progression dimension content type content width dominant baseline id index key k
124. ding are placed outside those edges Figure 9 16 shows the FO for two nested blocks with no margin attributes The text will be vertically aligned and the background colors will be placed outside the text Figure 9 17 shows the resulting output Figure 9 16 lt block padding 1cm background color 777777 gt Nested blocks with no plock 1 margins specified lt block padding 1cm background color 999999 gt block 2 lt block gt lt block gt Figure 9 17 Output from nested blocks with no margins In XSL FO terms both areas have the same start indent and hence the same content rectangle and the padding on the outer block extends outside its content rectangle This may seem counter intuitive to some developers used to the CSS model You can invoke the CSS nested areas model by specifying a margin left value even opt 58 Text Formatting Ibex PDF Creator Developers Guide 9 10 Spacing between letters The amount of space between two letters is dependent on the font used Ibex reads the TrueType or Type 1 font file and loads the width of each character Kerning information which specifies adjustments to the gaps between particular pairs of characters is also read from the font file and used in the text formatting process The spacing between letters can be changed using the letter spacing attribute Any value specified using this attribute is added to the default spacing specified by the font Figure 9 18 shows the F
125. duces a gradient from red to yellow horizontally lt xml version 1 0 standalone no gt lt svg width 8cm height 4cm viewBox 0 0 800 400 version 1 1 xmlns http www w3 org 2000 svg gt lt g gt lt defs gt lt linearGradient id MyGradient x1 100 x2 500 gradientUnits userSpaceOnUse gt lt stop offset 5 stop color F60 gt lt stop offset 95 stop color FF6 gt lt linearGradient gt lt defs gt lt rect fill none stroke blue Scalable Vector Graphics SVG images 117 Ibex PDF Creator Developers Guide x 1 y 1 width 798 height 398 gt lt rect fill url MyGradient stroke black stroke width 5 x 100 y 100 width 600 height 200 gt lt g gt lt svg gt producing this image The interpretation of the values specified for the coordinates x1 x2 y1 y2 of the linearGradient element changes depending on value specified for gradientUnits When gradientUnits userSpaceOnUse the specified values are in user space which is the space defined by the prevailing lt g gt element The specified coordinates are relative to the prevailing lt g gt element so two elements which use the same gradient as their fill color will appear differently if they are placed in different locations on the page This SVG image shows rectangles using the same gradient in conjunction with gradientUnits userSpaceOnUse lt xml version 1 0 standalone no gt lt s
126. e layout page width 8 5in page height 8in gt lt region body region name body margin 2 5cm gt lt simple page master gt lt layout master set gt lt page sequence master reference layout gt lt flow flow name body gt lt block gt Hello world lt block gt lt flow gt lt page sequence gt lt root gt The process of getting from your data to the formatting objects is carried out using the XSLT stylesheet which you provide This approach to PDF creation has a number of advantages the content and presentation are separated The format of the PDF file is defined by the XSLT stylesheet which can be created and maintained externally to the application Changing the stylesheet to alter the report layout does not require rebuilding your application formatting elements such as report headers and footers can be maintained in a separate stylesheet which is shared by many reports the formatting objects standard defines a powerful set of objects for creating page content It supports single column and multi column pages bookmarks indexing page headers and footers complex page numbering tables with optionally repeating headers and footers and many other features formatting objects is a high level approach which makes changing report layouts simple To change the number of columns on a multi column page you just need to change the column count attribute on a single element To do this using a lower level programmat
127. e Ibex may start rendering the table to PDF before the whole table has been read from the FO file This section describes the behavior of table footers which do not change Footers which can have different content on different pages are described later in this chapter in the section on continuation markers on page 91 Tables 89 Ibex PDF Creator Developers Guide Figure 15 30 shows the FO for a simple table with a one row header and footer and two content rows The output created by the FO appears in Figure 15 31 Figure 15 30 ese FO for simple table lt table column column width 1003 gt with header and lt table header gt lt table row gt footer lt table cell border l1pt solid black padding 5pt gt lt block gt Heading lt block gt lt table cell gt lt table row gt lt table header gt lt table footer gt lt table row gt lt table cell border 1pt solid black padding 5pt gt lt block gt Footer lt block gt lt table cell gt lt table row gt lt table footer gt lt table body gt lt table row gt lt table cell border l1pt solid black padding 5pt gt lt block gt row 1 lt block gt lt table cell gt lt table row gt lt table row border 1pt solid black padding 5pt gt lt table cell gt lt block gt row 2 lt block gt lt table cell gt lt table row gt lt table body gt lt table gt Figure 15 31 Table with simple header and footer Table footers are repeated at the
128. e URI used when Ibex searches for the included XML file BaseURI_XSL string This value sets the base URI for including other XSL files When an xsl include element is used to include another XSL stylesheet Settings BaseURI_XSL can be used to specify the location the included stylesheet should be loaded from 21 5 Images The following properties on the Settings effect retrieving images specified using the external graphic element Property Type Default Notes BaseURI_XML string This value sets the base URI for including images and other XML files When an external graphic element specifies a relative path Settings BaseURI_XML is the base URI used in accordance with the rfc2396 URI Specification When an XML file uses an entity to include another XML file Settings BaseURI_XML is the base URI used when Ibex searches for the included XML file WebRequestTimeoutMs int 300 When an external graphic element specifies an image is retrieved from a web server this is the timeout used for the call to the web server Units are milliseconds Configuration 133 Ibex PDF Creator 21 6 Border widths Developers Guide The following properties on the Settings change the values for border widths specified with constants like thin Property Type Default Notes BorderWidthThin string 1pt BorderWidthMedium string 2pt BorderWidthThick
129. e as determined from the image file Default value auto Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit scale to fit display align Description This attribute sets the vertical alignment of content contained within the element with this attribute Elements and Attributes 331 25 11 66 25 11 67 Ibex PDF Creator Developers Guide Default value inherited from parent Values auto before Align to before edge which for non rotated content is the top center Align to center after Align to after edge which for non rotated content is the bottom end indent Description This attribute sets indentation of content from the end edge of the containing area For non rotated content the end edge is the right edge This attribute sets the indentation of the content contained in the element The content will be positioned the required distance from the right edge of the containing area and any padding and border will then be placed outside the content For CSS style alignment of nested elements use the margin left and margin right attributes instead of start indent and end indent Default value opt Values auto lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit ends row Description
130. e body gt lt table row gt lt table cell border 1pt solid black padding 3pt gt lt block gt ibexdls lt block gt lt table cell gt lt table cell border 1pt solid black padding 3pt text align from table column gt lt block gt 499 02 lt block gt lt table cell gt lt table row gt lt table row gt lt table cell border 1pt solid black padding 3pt gt lt block gt Total lt block gt lt table cell gt lt table cell border 1pt solid black padding 3pt text align from table column font size 18pt gt lt block gt 499 00 lt block gt lt table cell gt lt table row gt lt table body gt lt table gt Output for decimal Total point alignment Tables 93 94 Tables 16 1 Chapter 16 Images Images are added to the document using either the external graphic or instream foreign object elements The external graphic element is used to include a file in JPEG GIF TIFF BMP SVG or PNG formats The instream foreign object element is used to include an image defined in Scalable Vector Graphics SVG format where the image SVG is contained within the FO The properties used to format the external graphic and instream foreign object elements are the same The size of the image is distinct from the size of the area in which the image is placed The height and width attributes on the external graphic or instream foreign object element specify the size of the area into which th
131. e color border before style border before width Elements and Attributes 227 Ibex PDF Creator border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left font family font size font size adjust font variant relative position top left alignment baseline dominant baseline grouping separator id index key keep with previous letter spacing line height ref id scale option 228 Elements and Attributes Developers Guide border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right font selection strategy font stretch font style font weight bottom right alignment adjust country format grouping size index class keep with next language letter value intrinsic scale value score spaces text altitude Ibex PDF Creator Developers Guide text depth text shadow text transform visibility word spacing wrap option Elements and Attributes 229 Ibex PDF Creator Developers Guide 25 4 Formatting objects for tables The objects described in this section are used to create t
132. e graphic will be placed If these properties are not specified they default to an area large enough to contain the image The content width and content height attributes control the size of the image These can be values such as 3cm or percentages such as 120 If content width and content height not specified the image defaults to the size in pixels specified in the image file itself This means that if you do not specify any of the above attributes the image will be as large as specified in the image file and will be placed in an area the same size The dots per inch dpi value of the image makes a difference to the image size Two images can have the same dimensions in pixels but appear different sizes in the PDF file This is because Ibex uses the dpi value to work out the size of the image An image which is 300 pixels wide and stored at 300 dpi will be 1 inch wide The same image stored at 100 dpi will be 3 inches wide An image is an inline element so for formatting purposes it can be placed in a sentence surrounded by text and is treated as a single word Image basics The external graphic element is used to include an image which is in a file external to the FO file The name of the file to be included is specified using the src attribute Images 95 Ibex PDF Creator Developers Guide The src attribute is called a uri specification and must follow the following rules A sequence of characters that is url followed by opt
133. e number suffix wrapper basic link title block inline folio suffix folio prefix bidi override marker Attributes The following attributes can be used on this element id index class index key 270 Elements and Attributes 25 8 3 Ibex PDF Creator Developers Guide footnote body Description This element is used to insert a the content of a footnote which will appear at the bottom of the region Child element s This element can contain the following elements block zero or more block container zero or more float one or more cannot be used inside an out of line element index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element list block zero or more retrieve marker one or more subject to constraints specified for this element table zero or more table and caption zero or more wrapper one or more subject to constraints specified for this element Parent element s This element can be contained in the following elements footnote Attributes The following attributes can be used on this element id index class index key Elements and Attributes 271 Ibex PDF Creator Developers Guide 25 9 Formatting objects for indexing These objects are used in creating an index at the end of a document 272 Elements and Attributes 25 9 1 Ibex PDF Creator Developers Guide index page nu
134. e omit footer at break Description By default a table footer element is repeated before every table break If you set this attribute to true the table footer will appear only once at the end of the table Default value false Values true Footer appears once at end of table false Footer appears at every page break table omit header at break Description By default a table header element is repeated after every table break If you set this attribute to true the table header will appear only once at the beginning of the table Default value false Values true header appears once at start of table false header appears after every page break text align Description This sets the text alignment of text contained within the element This does not align the last or only line of a paragraph see the text align last attribute for aligning the last line 368 Elements and Attributes 25 11 140 25 11 141 Ibex PDF Creator Developers Guide Default value start Values start same as left for non rotated content left center end same as right for non rotated content right justify text align last Description This sets the text alignment of text last line of a paragraph see the text align attribute for aligning lines other than the last one Default value start Values start same as left for non rotated content left center end same as right for non rotated content right justify
135. e so that different content can be displayed on different pages A typical use of this feature is to put the words continued on next page in the footer of a table on all pages except the last Here we examine how the continued on next page requirement can be satisfied using Ibex The approach taken by XSL FO has two parts implemented using the marker and retrieve table marker elements First a retrieve table marker element is added to the footer When the PDF is created this element will be replaced by the contents of one of the marker elements which has the same class name The marker element which appears in the footer depends on the values of the attributes on the retrieve table marker The footer for this example is shown in Figure 15 32 As the PDF file is created the contents of the marker element with marker class name continued will be located and inserted into the table footer element The content of the marker element must be valid FO elements for their location in the table footer In this example the retrieved elements go directly under the table footer element so the elements retrieved must be table row elements Figure 15 32 g 53 lt table footer gt FOfor lt retrieve table marker retrieve table marker retrieve class name continued retrieve position within table first starting retrieve boundary within table page gt lt table footer gt Typically there will be more than one marker element which has the marker
136. e the current baseline by 5 points is shown in Figure 9 35 with the resulting output appears in Figure 9 36 Figure 9 35 77 lt block FO showing hello baseline shift lt inline color red baseline shift 5pt gt super lt inline gt lt block gt Figure 9 36 Output from the above FO hellig gt 62 Text Formatting Figure 9 37 Using the default superscript Ibex PDF Creator Developers Guide Font files contain default baseline shift values for superscripted and subscripted text Rather than specifying baseline shift 5pt you can use the values super and sub The FO to move a word above the current baseline by the default amount for the current font is shown in Figure 9 37 with the resulting output in Figure 9 38 Using the sub and super values is preferable to using specific measurements because it means a if you change the font size of the paragraph you do not have to change all the baseline shift values and b you get the baseline sift the font designer intended lt block hello lt inline color red baseline shift super gt super lt inline gt lt block gt Figure 9 38 Output from the above FO hello 9 15 9 16 Figure 9 39 An image on the baseline super Line stacking strategies XSL FO uses the line stacking strategy attribute to determine how lines are stacked vertically on a page The default value of this attribute is max height When the max height strategy is used
137. e used on this element flow map name For an example showing the use of the element see 180 Elements and Attributes 25 1 22 Ibex PDF Creator Developers Guide flow assignment Description The flow assignment is used to assign a list of flows to a list of regions Child element s This element can contain the following elements flow source list exactly one flow target list exactly one Parent element s This element can be contained in the following elements flow map For an example showing the use of the element see Elements and Attributes 181 25 1 29 Ibex PDF Creator Developers Guide flow source list Description The flow source list contains a list of flow name specifier elements which specify the names of flows which will be assigned by the containing flow map Child element s This element can contain the following elements flow name specifier one or more Parent element s This element can be contained in the following elements flow assignment For an example showing the use of the element see 182 Elements and Attributes 25 1 24 Ibex PDF Creator Developers Guide flow name specifier Description The flow name specifier has one attribute which specifies the name of a flow This is used in the flow map element to add the named flow to a list of flows mapped to regions Child element s This element can contain the following elements This element must be empty Paren
138. e with red and black letters on a white background Figure 16 23 Image placed over This is some text that will be behind the image This is text some text that will be behind the image This is some text that will be behind the image This is some text that will be behind the image text that will be behind the image This is will be behind the image This is some Ibex XSL be behind the image This is some text tmar w De ind the image If we add a mask to eliminate white pixels the image then appears as shown in Figure 16 24 Figure 16 24 Image with maskin g 6 This is some text that will be behind the image This is some text that will be behind the image This is some text that will be behind e imag hils is some text that will be behind the eee exixS text that will be behind the image 16 8 4 Transparent Images using SVG Transparent images can also be implemented by placing a SVG image over the top of other content This approach uses the vector SVG renderer introduced in Ibex 2 1 2 and is Images 103 Ibex PDF Creator Developers Guide only available when using NET 1 1 or higher This is the best approach for transparent images because a there is no background on the SVG image so the best clarity is achieved and b SVG uses a vector renderer which creates a smaller PDF file than you would get using a bitmap image Figure 16 25 shows the FO to put the word ibex over some text The resulting output is shown in F
139. eator Developers Guide leader Description This element is used to draw a horizontal line across the page A simple line is drawn like this lt block gt lt leader leader pattern rule rule thickness 0 2pt gt lt block gt The leader can also be drawn between other pieces of text on the same line and can be set to expand to fill available space like this lt block text align justify text align last justify gt This is before the leader lt leader leader pattern rule rule thickness 0 2pt gt this is after the leader lt block gt producing the effect below Note the use of text align last which is required to justify the single line paragraph This is before the leader this is after the leader Setting the leader pattern attribute to dots changes the line into dots like this This is before the leader 2 ccc cece cece rere rere re rnsevece this is after the leader Setting the leader pattern attribute to space changes the line into spaces like this This is before the leader this is after the leader The use of leader pattern use content is not supported Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title block inline 214 Elements and Attributes Ibex PDF Creator Developers Guide folio suffix
140. ed the label column will overlap the body column Child element s This element can contain the following elements list item Parent element s This element can be contained in the following elements wrapper basic link float footnote body static content table caption block block container inline inline container bidi override table cell list item label list item body marker Attributes The following attributes can be used on this element background attachment background color background image background repeat background position horizontal background position vertical border border before color border before style border before width border after color border after style border after width border start color Elements and Attributes 253 Ibex PDF Creator border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left relative position top left margin top margin right space before start indent break after clear index class intrusion displace keep with next provisional distance between starts Elements and Attributes Developers Guide border start width border end style border top border top style border bottom border bottom style border left border left style border right border right s
141. eep with next line height scaling src width For an example showing the use of the element see 204 Elements and Attributes 20300 Figure 25 9 Ibex PDF Creator Developers Guide instream foreign object Description This element is used to place an object which is contained in the XML into the PDF document The only supported object type is an SVG image An example of include an inline SVG image is lt instream foreign object width 20 height 1cm gt lt svg xmlns fo http www w3 org TR xsl Format xmlns http www w3 org 2000 svg gt lt path style stroke width 1 fill rgb 246 127 0 d M204 33 139 83 C196 33 133 33 z gt lt svg gt lt instream foreign object gt Not all implementations of Ibex support SVG images Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title block inline folio suffix folio prefix bidi override marker Elements and Attributes 205 Ibex PDF Creator Attributes Developers Guide The following attributes can be used on this element 206 background attachment background image background position horizontal border border before style border after color border after width border start st
142. efault value the value of the color property Values lt color gt A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color inherit border left style Description Sets the left border style For example border left style solid Default value none 310 Elements and Attributes 25 11 34 Figure 25 43 Ibex PDF Creator Values lt border style gt inherit border left width Description Developers Guide Can be any of the values none solid double dashed dotted inset outset groove ridge No border A single solid line this is 1pt solid black Two lines separated by a gap The gap is 1 3 of the width of the border this is 4pt black double See example i this is 2pt black dashed Pee a See example E this is 2pt black dotted The top and left borders are slightly darker then the required color and the bottom and right borders are slightly lighter this is 2pt blue inset See example this is 2pt blue outset See example See example Sets the left border width For example border left width l1pt Default value medium Elements and Attributes 311 25 11 35 Figure 25 44 Ibex PDF Creator Developers Guide Values lt border width gt Can be any of the values thin A thin border The actual default width is Settings BorderWidthThin and so can be changed programatically
143. egion before which have their size set by the extent attribute If content is placed in the region using a static content element the content may be too large for the region If this happens and the overflow attribute is set to hidden the content will not appear Elements and Attributes 351 25 11 106 Figure 25 102 2911107 Ibex PDF Creator Developers Guide Default value auto Values hidden Content which exceeds the elements boundaries will be discarded auto Content which exceeds the elements boundaries will be displayed visible Content which exceeds the elements boundaries will be displayed padding Description Padding is space which appears between the border of an element and the content such as text of that element This is a shorthand way of setting padding top padding bottom padding right and padding left To set all paddings to the same size use a single value like this padding 1pt Default value Shorthand properties do not have default values See individual properties for their default values Values inherit lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points padding after Description Padding is space which appears between the border of an element and the content such as text of that element 352 Elements and Attributes Figure 25 103 25 11 108 Figure 25 104 Ibex PDF
144. elopers Guide 9 2 Using the font family attribute The font family attribute is used to specify the name of the font to use More than one font name can be listed These names can be specific font names such as times roman or garamond or generic names such as monospace Ibex will use the first name in the list which matches a font on your system Font names are separated by a comma The ability to list multiple font names derives from the CSS standard It is designed to support the creation of a web page which will be rendered on a computer that may not have the same fonts installed as the page s author In practice when you generate a PDF file you know what fonts you have installed so you will probably just specify one font 9 3 Italic text Text is made italic using the font style attribute The font style can be normal or italic Other font values such as the font family are inherited from the current font as shown in Figure 9 5 The output created by the FO in Figure 9 5 is shown in Figure 9 6 Figure 9 5 lt block font family arial gt Using font style hello lt inline font style italic gt world lt inline gt lt block gt Figure 9 6 Using the font style hello world attribute 9 4 Bold text Text is made bold using the font weight attribute The font weight can be normal or bold as shown in Figure 9 7 The output created by the FO in Figure 9 7 is shown in Figure 9 8 Figure 9 7 lt block f
145. em body start indent body start gt lt block gt item two lt block gt lt list item body gt lt list item gt lt list block gt producing the following content e item one e item two The list is rendered as two columns The first column is called the label the second is called the body The distance from the start of the label column to the start of the body column is set by the provisional distance between starts attribute The gap between the columns is set by the provisional label separation attribute The width of the label column is therefore provisional distance between starts provisional label separation Each item in the list is contained in a list item element The list item contains exactly one list item label and list item body element with the list item label coming first The list item label should always have its end indent attribute set to label end which is a function returning a value calculated from the provisional distance between starts and provisional label separation attributes If the end indent is not so specified the label column will overlap the body column The list item body should always have its start indent attribute set to body start which is a function returning a value calculated from the 252 Elements and Attributes Ibex PDF Creator Developers Guide provisional distance between starts and provisional label separation attributes If the start indent is not so specifi
146. ement This should be set a value used as the id attribute of the element to be linked to Default value keep together Description Set this attribute to always to keep content together on one page If content with keep together always will not fit on what remains of a page it will be moved to the next page If it is larger than the region in which it is being placed it will be split Elements and Attributes 343 25 11 86 25 11 87 25 11 88 Ibex PDF Creator Developers Guide Default value auto keep with next Description Set this attribute to always to keep the content with the next element in the FO If both elements do not fit on a page they will both be moved to the next page This is typically used to keep a heading together with the content which follows Any number of elements can be kept together by having keep with next always set on each one If the list to be kept together exceeds the size of the region in which they are being placed they will not be kept together Default value auto keep with previous Description Set this attribute to always to keep the content with the previous element in the FO If both elements do not fit on a page they will both be moved to the next page This is typically used to keep a the last two rows of a table together so that a single row is never displayed by itself Any number of elements can be kept together by having keep with previous always set o
147. emented external graphic implemented instream foreign object implemented in NET not in Java inline implemented inline container implemented leader implemented page number implemented page number citation implemented page number citation last implemented folio prefix implemented folio suffix implemented scaling value citation implemented 374 Compliance with the XSL FO standard Ibex PDF Creator Developers Guide 26 4 Formatting objects for tables Element table and caption Status implemented table implemented table column implemented table caption implemented table header implemented table footer implemented table body implemented table row implemented table cell implemented 26 5 Formatting objects for lists Element Status list block implemented list item implemented list item table body implemented list item label implemented 26 6 Dynamic effects link and multi formatting objects Element basic link Status implemented multi switch not implemented not relevant to PDF multi case not implemented not relevant to PDF multi toggle not implemented not relevant to PDF multi properties not implemented not relevant to PDF multi property set not implemented not relevant to
148. ent adjust baseline shift id index key keep with previous line height score spaces text decoration text shadow Developers Guide border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right font selection strategy font stretch font style font weight margin top margin right relative position top left alignment baseline dominant baseline index class keep with next letter spacing ref id text altitude text depth text transform Elements and Attributes 223 Ibex PDF Creator Developers Guide visibility word spacing wrap option For an example showing the use of the element see Figure 25 12 224 Elements and Attributes 25 3 12 Ibex PDF Creator Developers Guide folio prefix Description This element is used create a prefix which appears before the page number inserted by page number page number citation and page number citation last Child element s This element can contain the following elements text basic link zero or more bidi override zero or more character zero or more external graphic zero or more float one or more cannot be used inside an out of line element footnote one or more cannot be used inside an out of line element index page citation last zero or more index range begin one
149. ents root page sequence wrapper Attributes The following attributes can be used on this element country flow map reference format language letter value grouping separator grouping size id index class index key initial page number force page count master reference reference orientation Elements and Attributes 155 Ibex PDF Creator Developers Guide writing mode For an example showing the use of the element see Figure 25 1 156 Elements and Attributes 25 1 5 Figure 25 2 P Ibex PDF Creator Developers Guide page sequence wrapper Description This element is used to specify attributes which can be inherited by a group of page sequence elements which are contained in the page sequence wrapper Child element s This element can contain the following elements page sequence zero or more page sequence wrapper zero or more Parent element s This element can be contained in the following elements root page sequence wrapper Attributes The following attributes can be used on this element id index class index key For an example showing the use of the element see Figure 25 2 xml version 1 0 encoding UTF 8 gt Using lt root xmlns http www w3 org 1999 XSL Format gt Ppage sequence wrapper lt layout master set gt lt simple page master master name simple gt lt region body margin 2 5cm region name body background color eeeeee gt lt simple page master gt
150. ents and Attributes Developers Guide padding right border before precedence border start precedence column width number columns spanned 25 4 4 Ibex PDF Creator Developers Guide table caption Description This element is used to contain block level formatting objects containing the caption for the table It is used as part of a table and caption element Child element s This element can contain the following elements block zero or more block container zero or more float one or more cannot be used inside an out of line element index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element list block zero or more retrieve marker one or more subject to constraints specified for this element table zero or more table and caption zero or more wrapper one or more subject to constraints specified for this element Parent element s This element can be contained in the following elements table and caption Attributes The following attributes can be used on this element background attachment background color background image background repeat background position horizontal background position vertical border border before color border before style border before width border after color border after style border after width border start color border start style border start width border end color b
151. ents must be in the order listed Child element s This element can contain the following elements bookmark tree zero or one declarations zero or one layout master set exactly one page sequence zero or more page sequence wrapper zero or more Attributes The following attributes can be used on this element For an example showing the use of the element see Figure 25 1 Figure 25 1 p media usage id index key index class xml version 1 0 encoding UTF 8 gt Using root lt root xmins http www w3 org 1999 XSL Format gt lt layout master set gt lt simple page master master name simple gt lt region body margin 2 5cm region name body background color eeeeee gt lt simple page master gt lt layout master set gt lt page sequence master reference simple gt lt flow flow name body gt lt block gt Hello World lt block gt lt flow gt lt page sequence gt lt root gt 152 Elements and Attributes 20 1 2 Ibex PDF Creator Developers Guide declarations Description The declarations formatting object is used to group global declarations for a stylesheet In Ibex it acts as a container for the color profile element which is used in PDF X files See 143 for more information Child element s This element can contain the following elements color profile Parent element s This element can be contained in the following elements root Elements
152. er addHandler new StreamHandler stream catch Exception 6 2 2 Setting the MIME type We set the correct MIME type to cause the browser to invoke the Acrobat plugin to display the PDF Response ContentType application pdf 6 2 3 Setting the content length We set the content length to IE will correctly handle the content Response AddHeader content length System Convert ToString pdfStream Length 6 2 4 Not closing the MemoryStream We call the version of generate that takes a boolean to indicate we do not want the output stream to be closed If it were closed we would not be able to extract the PDF data from the MemoryStream in order to copy it back to the browser Typically if we Using Ibex with ASP NET 35 Ibex PDF Creator Developers Guide were writing the PDF to a file on disk we would close the stream but in this case we need to stream to stay open using dataStream doc generate dataStream pdfStream false 6 3 Using XSLT If we want to translate our XML data using a stylesheet the ASP code needs to be changed as shown in Figure 6 3 Figure 6 3 ASP page using XSLT using System using System Collections using System ComponentModel using System Data using System 10 using System Text using System Drawing using System Web using System Web SessionState using System Web UI using System Web UI WebControls using System Web UI HtmlControls using System Xm
153. er and page sequence master elements we have no page sequence master elements in this example and finds one with a master name attribute which equals the master reference attribute on the page sequence If Ibex does not find a matching page master the FO file is invalid and Ibex will throw an exception lt page sequence master reference simple gt lt flow flow name body gt lt block gt Hello World lt block gt lt flow gt lt page sequence gt Within the page sequence element we have a flow element This holds the content which will appear on one or more pages A page can have multiple regions To associate content with a region we use the flow name attribute on the flow element In order for the content contained in the flow to appear on the page the flow name of the flow should match a region name of one of the regions in this example the region body on the page If the flow name of the flow does not match a region name of one of the regions on the page the content is not displayed on that page This is not an error It is a useful feature and we show how to use it later in this chapter Looking at the FO in Figure 4 7 the underlined names must match each other and the names in italics should match if you want the content to appear lt layout master set gt lt simple page master master name simple gt lt region body margin 2 5cm region name body background color eeeeee gt lt simple page master gt lt
154. er object synchronises access to the log file If you omit the clearHandlers call shown in the above example log records will be written to the default console handler and also to the file handler You will see error messages on the console and they will also be written to the file 7 3 Logging to a stream Ibex can log messages to a stream created by the caller The stream is any object which implements the System lO Stream interface To log messages to a stream create an ibex4 logging StreamHandler object and then tell the logger to log to this object The example in Figure 7 4 logs to a MemoryStream but any valid stream can be used g Figure 7 4 META System Logging to a stream using System 10 using ibex4 using ibex4 logging public class Create joroMlaie Cleaner Siyealicl Wicwlin Gherealieve aves 4 Logger getLogger clearHandlers MemoryStream stream new MemoryStream StreamHandler h new StreamHandler stream Logger getLogger addHandler h 40 Error Handling amp Logging Ibex PDF Creator Developers Guide If you omit the clearHandlers call shown in the above example log records will be written to the default console handler and to the stream handler as well 7 4 Logging to multiple destinations Errors can be logged to any number of handlers The example in Figure 7 5 logs to a file called xslfo log to a memory stream and to the console Figure 7 5 MEP System Logging to multi
155. er top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left Ibex PDF Creator padding right margin top margin right space before start indent block progression dimension break before clip height index class inline progression dimension keep together keep with previous reference orientation width z index Developers Guide margin margin bottom margin left space after end indent break after clear display align id index key intrusion displace keep with next overflow span writing mode For an example showing the use of the element see Elements and Attributes 193 Ibex PDF Creator Developers Guide 25 3 Inline level formatting objects The objects described in this section are used directly contain and format text and other inline elements which are usually formatted across the page 194 Elements and Attributes 25 3 1 Ibex PDF Creator Developers Guide bidi override Description This element is used when the Unicode BIDI algorithm fails to force some text to be written in a specific writing direction Child element s This element can contain the following elements text basic link zero or more bidi override zero or more block zero or more block container zero or more character zero or more external graphic zero or more float one or more canno
156. ext column below the span all blocks We deliberately repeat the paragraph to demonstrate this wrapping This block does not have span all so it will be fitted into the first column in the page Text will flow to the bottom of this page and then start at the top of the next column If there are blocks above this one on the page as there are which have span all then they will remain in place and the text which is in only one column will be placed in the next column below the span all blocks It is also possible to have a page start with content in two columns like this When a block level object is encountered which has span all the content already on the page is pushed up to the top and the block with span all is spread over the two columns Columns 127 128 Columns Figure 20 1 A bookmark tree Chapter 20 Bookmarks Bookmarks are the entries which appear on the right in a PDF file in Adobe Acrobat They are used to navigate directly to locations within the document They also have a hierarchical structure where one bookmark can contain a set of child bookmarks which in turn can themselves contain other bookmarks The bookmark tree element is optional If used it should be placed under the root element after the layout master set and declarations elements and before any page sequence or page sequence wrapper elements The structure of a bookmark tree is shown in Figure 20 1 lt bookmark tree g
157. extent region name writing mode Developers Guide border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right display align overflow reference orientation For an example showing the use of the element see Figure 25 5 Elements and Attributes 173 20 1 17 Ibex PDF Creator Developers Guide region end Description This element defines the shape of a region which is at the right of a non rotated page Content from static content elements whose flow name matches the region name will be placed in this region The region has a default name of xsl region start which is usually changed to something simpler such as right using the region name attribute Within the region all of the content can be aligned to the top bottom or middle of the region using the display align attribute The content of the region can be rotated using the reference orientation attribute Unlike the region body element the region end does not have margin properties The size of the region is defined using the extent attribute Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements simple page master Attributes The following attributes can be used on this element background attachment background color backgroun
158. f a fallback RGB color the fourth defines the color profile name and the last four define the four parts of the CMYK color The color profile must have been declared in the declarations formatting object using a color profile element Figure 13 5 shows an example of the rgb icc function Figure 13 5 g lt block color rgb icc 0 0 0 cmyk 0 7 0 3 0 3 0 4 gt The rgb icc function in cmyk 5 5 5 0 lt block gt In Figure 13 5 the three components of the fallback RGB color are zero This is normal because we are creating a CMYK PDF file and will not be using any fallback RGB colors The color profile name is cmyk Ibex requires that the color profile name be cmyk when creating a CMYK color A complete document using the CMYK color space is shown in Figure 13 6 This shows how to use the declarations and color profile elements to define a color profile Figure 13 6 lt xml version 1 0 encoding UTF 8 gt FO fora CMYK PDF croot xmlns http www w3 org 1999 XSL Format gt file lt layout master set gt lt simple page master master name page gt lt region body margin lin region name body gt lt simple page master gt lt layout master set gt lt declarations gt lt color profile src src color profile name cmyk gt lt declarations gt lt page sequence master reference page gt lt flow flow name body gt qollie ele Collonm selo aee WO O O Givi WoI Ucs 0 3 0 4 VS Il
159. fault value auto Values auto lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points lt percentage gt A percentage such as 10 The value is calculated as a percentage of the parent elements height lt length range gt The value has three sub components namely minimim optimum and maximum Each of these can be set to a lt length gt value inherit border Description Sets the border for all four sides of an element to the same value Any of the values listed can be combined for example you can have border 12pt solid red Default value Shorthand properties do not have default values See individual properties for their default values Values lt color gt A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color lt border width gt Can be any of the values thin A thin border The actual default width is Settings BorderWidthThin and so can be changed programatically 296 Elements and Attributes 25 11 16 Figure 25 23 Ibex PDF Creator lt border style gt inherit border after color Description medium thick lt length gt Developers Guide A medium border The actual default width is Settings BorderWidthMedium and so can be changed programatically A thick border The actual default width is Settings BorderWidthThick and so c
160. fix bidi override marker Attributes The following attributes can be used on this element background attachment background image background position horizontal border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width background color background repeat background position vertical border before color border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left Elements and Attributes 209 Ibex PDF Creator border left color border left width border right color border right width padding before padding start padding top padding left font family font size font size adjust font variant margin margin bottom margin left bottom right alignment adjust baseline shift color height index class inline progression dimension keep with next line height visibility wrap option Developers Guide border left style border right border right style padding padding after padding end padding bottom padding right font selection strategy font stretch font style font weight margin top margin right relative position top left alignment baseline block progression dimension dominant baseline id index key keep together keep with previous text decoration
161. for this element scaling value citation zero or more table zero or more table and caption zero or more wrapper one or more subject to constraints specified for this element Elements and Attributes Ibex PDF Creator Developers Guide Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title float footnote body static content table caption block block container inline folio suffix folio prefix inline container bidi override table cell list item label list item body marker Attributes The following attributes can be used on this element id index class index key Elements and Attributes 285 25 10 4 Ibex PDF Creator Developers Guide marker Description This element contains some content which will be retrieved elsewhere in the document using a retrieve marker element Typically marker is used to set some piece of text such as the current chapter title which is then retrieved within a static content element for placing in the page header The Ibex manual uses this technique to place the current chapter name in the top right corner of most pages An marker cannot be used in static content elements and a retrieve maker can be used only in static content elements An marker uses the marker class name attribute to group markers which
162. found e when a formatting error occurs such as defining the widths of columns in table that exceed the available width As the Ibex Logger is a singleton object logging should be configured once at the start of an application not on a per document basis Error severity To change the level of information logged you can set the level on the logging object to one of the values defined in the ibex4 logging Level object Possible levels of logging which can be set are SEVERE WARNING INFO CONFIG FINE FINER FINEST An example of how to set the logger to log only messages which are WARNING or worse is shown in Figure 7 2 Error Handling amp Logging 39 Ibex PDF Creator Developers Guide Figure 7 2 using System Setting the error level using ibex4 using ibex4 logging public class Create public static void Main string args PDFDocument doc new PDFDocument Logger getLogger setLevel Level WARNING 7 2 Logging to a file To log messages to a file create an ibex4 logging FileHandler object and then tell the logger to log to this object The example in Figure 7 3 logs to the file log txt but any valid file name can be used Figure 7 3 a System Logging toa file using ibex4 using ibex4 logging public class Create pwalic Cieeiese swoalcl Mainil ecringiil azge J 4 Logger getLogger setLevel Level SEVERE clearHandlers addHandler new FileHandler log txt The FileHandl
163. gap The gap is 1 3 of the width of the border this is 4pt black double dashed See example i this is 2pt black dashed i Pee a dotted See example F this is 2pt black dotted i inset The top and left borders are slightly darker then the required color and the bottom and right borders are slightly lighter this is 2pt blue inset outset See example this is 2pt blue outset groove See example 298 Elements and Attributes Ibex PDF Creator Developers Guide ridge See example inherit 25 11 18 border after width Description Sets the after border width which for a non rotated object is the bottom one For example Figure 25 25 border after width 1pt Default value medium Values lt border width gt Can be any of the values thin A thin border The actual default width is Settings BorderWidthThin and so can be changed programatically medium A medium border The actual default width is Settings BorderWidthMedium and so can be changed programatically thick A thick border The actual default width is Settings BorderWidthThick and so can be changed programatically lt length gt A length such as 1ocm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit 25 11 19 border before color Description Sets the before border color which for a non rotated object is the top one For example Elements and Attributes 299 Ibex PDF Creator
164. ge which has multiple columns just like this one This can only be done for whole pages not for partial pages However if we are in a region which has multiple columns we can treat it as a single column region and place output across the whole width of the multi column page by setting span all on block level elements which appear immediately below the flow element Columns are defined by setting the column count attribute of a body region element to a value greater than 1 and optionally setting the column gap attribute to define a gap between the columns The page master for this is similar to the one shown in Figure 19 1 lt simple page master master name chapter 2col odd gt lt region start extent 2 5cm gt lt region end extent 2 5cm gt lt region body column count 2 region name body margin 2 5cm gt lt region after region name footer odd extent 2 5cm gt lt region before region name header odd extent 2 5cm gt lt simple page master gt All the blocks above including this one have span all set so that they span the whole page This block does not have span all so it will be fitted into the first column in the page Text will flow to the bottom of this page and then start at the top of the next column If there are blocks above this one on the page which have span all as there are then they will remain in place and the text which is in only one column will be placed in the n
165. gger getLogger addHandler catch Exception j FODocument doc new FODocument string dataFilePath Server MapPath stream for output in memory before sending to browser FileMode Append MemoryStream pdfStream new MemoryStream FileStream dataStream new FileStream FileMode Open FileAccess Read Logger getLogger info data file path using dataStream doc generate dataStream pdfStream Response Clear Response ContentType application pdf Response AddHeader content length System Convert ToString pdfStream Response BinaryWrite pdfStream ToArray Response End override protected void OnInit EventArgs e 34 InitializeComponent base OnInit e Using Ibex with ASP NET is false Length i System EventArgs e new StreamHandler dataFilePath stream de AANE seen p r dataFilePath Ibex PDF Creator Developers Guide private void InitializeComponent this Load new System EventHandler this Page_Load Key points about the process of streaming the PDF are covered in the following sections 6 2 1 Logging We set up logging so if an error occurs we get the error logged to file Logger getLogger setLevel Level FINEST clearHandlers tey l Stream stream new FileStream Server MapPath logs log txt FileMode Append FileAccess Write Logger getLogg
166. gt elements Images can be included inline like this lt fo block border l1pt solid red gt lt fo instream foreign object gt lt svg xmlns http www w3 org 2000 svg width 20 height 20 gt lt rect width 10 height 10 fill green gt lt svg gt lt fo instream foreign object gt lt fo block gt or from an external file like this lt fo block border l1pt solid red gt lt fo external graphic src url file svg gt lt fo block gt where the external file contains the SVG image like this lt xml version 1 0 encoding UTF 8 gt lt svg xmlns http www w3 org 2000 svg width 20 height 20 gt lt rect width 10 height 10 fill green gt lt svg gt If an image occurs more than once in the document it should be loaded from an external file so that it is only store in the PDF once Namespaces The SVG image must begin with the lt svg gt element in the namespace http www w3 org 2000 svg Images which do not declare the namespace will not be included in the PDF Scalable Vector Graphics SVG images 107 Lie 17 4 17 4 1 17 4 2 Ibex PDF Creator Developers Guide Image size The size of the image should be specified using the width and height attributes the outer lt svg gt element These can be absolute measurements such as 3cm or scalar values such as 400 Scalar values are assumed to be pixels and are converted to inches based on 1 pixel 1 96 inch Percentages can
167. h the user password will not be able to print the document deny extract true If this is set to true a user who opens the false document with the user password will not be able to use cut and paste functionality to copy part of the document deny modify true If this is set to true a user who opens the false document with the user password will not be able to modify the document Setting any of the attributes listed above will cause Ibex to encrypt the document Specifying the user password but not the owner password will set the owner password to the same value as the user password This means anyone who can open the document using the user password has complete control of the document Specifying the owner password but not the user password is common usage This means the user can open the document with limited rights without needing a password but cannot then change or exceed those rights without knowing the owner password 136 Extensions Ibex PDF Creator Developers Guide 22 1 2 128 bit encryption security options When the number of bits of encryption is set to 128 the attributes of the ibex security element are user password Specifies a password required to open the document in Acrobat Once the document is opened with the correct user password access is limited to permissions given using the attributes below owner password Specifies a password required to get all rights to the document in Acrobat Once the document is
168. have a common purpose The retrieve marker element has some attributes to specify which marker should be retrieved such as the first or last one in the document or the first or last one on that page Child element s This element can contain the following elements text basic link zero or more bidi override zero or more block zero or more block container zero or more character zero or more external graphic zero or more float one or more cannot be used inside an out of line element footnote one or more cannot be used inside an out of line element index page citation last zero or more index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element inline zero or more inline container zero or more instream foreign object zero or more leader zero or more list block zero or more page number zero or more 286 Elements and Attributes Ibex PDF Creator Developers Guide page number citation zero or more page number citation last zero or more retrieve marker one or more subject to constraints specified for this element scaling value citation zero or more table zero or more table and caption zero or more wrapper one or more subject to constraints specified for this element Parent element s This element can be contained in the following elements Attributes The following attributes c
169. he layout of the document using the elements from the XSL Formatting Objects standard The XML you provide to Ibex can come from any source Typically it is extracted from a database or generated dynamically for each document The formatting objects FO standard defines elements such as table row and cell which can be used to lay out your data on a page It also defines objects for describing the overall shape and layout of the page including parameters such as page size number of columns and regions where content will be placed on the page The process of creating a document in FO format is carried out using an XSLT stylesheet The stylesheet transforms your XML data into standard FO syntax Ibex then reads that XSL FO and creates the PDF file The actual execution of the XSLT translation can be done either by Ibex which uses the NET framework XSL translation objects or externally to Ibex using any XSLT engine Figure 1 1 shows some XML data for creating a page which says Hello world The corresponding formatting objects from which the PDF is created are shown in Figure 1 2 Figure 1 1 lt xml version 1 0 encoding UTF 8 gt Simple XML lt expression gt hello world lt expression gt Introduction 1 Figure 1 2 Example formatting objects for hello world ike Ibex PDF Creator Developers Guide lt root xmlns http www w3 org 1999 XSL Format gt lt layout master set gt lt simple page master master nam
170. hese will apply to top right bottom and left edges in that order Cell background color The background color of a cell is specified using the background color attribute This supports the same predefined colors as CSS and the use of hex values such as 33ffcc The background color of the cell extends to the inside edge of the border which means that the area specified by the padding attribute is colored by the background color This is shown in Figure 15 4 where the second cell has the attribute background color dddddd Figure 15 4 Cell with background color set to Wipe so the text is tnis Cell has Packing set tehiskeel iliihas padding set tonspeu soithe text is not so close to the edges of the cell The background color covers the padding close to the edges of the cell If you do not want the background to extend to the edge of the padding specify the background color attribute on the contents of the cell i e the block elements rather than on the table cell An example FO for this is shown in Figure 15 5 and the resulting output appears in Figure 15 6 82 Tables Ibex PDF Creator Developers Guide Figure 15 5 apres FO setting the lt table body gt background color on lt table row gt lt table cell border 1pt solid blue padding 1pt gt a block 2pldek gt this cell has padding set to lpt so the text is close to the edges of the cell lt block gt lt table cell gt lt table cell border 1lpt
171. hich creates the output shown in Figure 4 41 26 Introduction to XSL FO Ibex PDF Creator Developers Guide Figure 4 40 dapres Table with table column lt table column column width 30 column number 1 gt lt table column column width 70 column number 2 gt elements lt table body gt lt table row gt lt table cell border 1pt solid blue padding 2pt gt lt block gt row 1 column 1 lt block gt lt table cell gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 1 column 2 lt block gt lt table cell gt lt table row gt lt table row gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 1 column 1 lt block gt lt table cell gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 1 column 2 lt block gt lt table cell gt lt table row gt lt table body gt lt table gt Figure 4 41 Rendered table with specified widths For more information on tables see page 81 Introduction to XSL FO 27 28 Introduction to XSL FO 5 1 5 1 1 Chapter 5 Using Ibex This chapter describes how to call the Ibex API and how to use the accompanying command line program lbex command line program Although primarily intended to be used as a part of a larger application Ibex ships with a command line program which can be used to create PDF files from FO files The command line programs shipped with Ibex are ibex10 exe which
172. his template outputs the root layout master set and page sequence elements Then for each city record in the data outputs a block element using the template shown in Figure 3 4 Figure 3 4 lt xsl template match city gt weather data xsl lt block gt subset lt xsl value of select name gt amp 160 lt xsl value of select temp gt lt block gt lt xsl template gt We can translate and format this example using the command ibex20 xsl weather xsl weather xml weather pdf The result of this translation is the file weather pdf Getting Started with Ibex 9 sas Ibex PDF Creator Developers Guide Required skills To use Ibex you need know how to edit XSL stylesheets Some familiarity with XSLT is required although in depth knowledge is not The Ibex website contains examples of using XSLT for common document related functions such as creating a table of contents Familiarity with XSL FO is not required This manual contains enough information to enable you to produce complex documents using Ibex 10 Getting Started with Ibex 4 1 Figure 4 1 Chapter 4 Introduction to XSL FO This chapter provides an overview of formatting objects and provides some suggestions on how to create PDF documents from XML files We also look at the techniques for using XSLT transformation to create FO files Layout of an FO file A very simple FO file is shown in Figure 4 1 lt xml version 1 0 encoding UTF 8
173. how to list the fonts which Ibex can use can be found in the usage chapter on page 30 Ibex reads the registry to see which fonts are available Specifically the entries under HKLM software microsoft windows nt currentversion fonts list available fonts and those under HKLM software microsoft windows nt currentversion fontsubstitutes list translations from font names to existing fonts Any of the font names listed in these two places can be used In addition Type 1 font names are read from HKLM software microsoft windows nt currentversion type 1 installer type 1 fonts Only Type 1 fonts that come as a PFM metrics and PFB binary pair of files are supported How Ibex uses fonts Your FO file contains a series of letters Each of which is stored in the file as a one or two byte code point such as 65 for A or 0x8226 for the bullet character Ibex reads the TrueType or Type 1 font file and looks in the font to see if the font supports that particular code point If it does then the font maps that code point to a glyph which is what gets displayed Not all fonts support all code points For example arial ttf is 370 KB in size whereas arialuni ttf is 23 000 KB because arialuni has glyphs for a many more code points that arial ttf Not all fonts map a code point to the same glyph Some fonts map code points they do not support to a glyph such as the square box one Fonts 65 66 Fonts Chapter 11 Floats The float element
174. iated column number which determines which column the table column element refers to This column number is either implied with the first table column element applying to the first column the second to the next etc or explicitly set using the column number attribute A single table column element can be used to define the style of multiple columns by using the number columns spanned attribute Figure 15 14 shows the FO for a table with two table column elements which apply to the first and second columns In this case they set the column widths to 30 and 70 and the give the second column a shaded background The output created from the FO appears in Figure 15 15 Figure 15 14 lt table gt FO using table column lt table column column width 30 gt elements lt table column column width 70 background color dddddd gt lt table body gt lt table row gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 1 column 1 lt block gt lt table cell gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 1 column 2 lt block gt lt table cell gt lt table row gt lt table row gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 2 column 1 lt block gt lt table cell gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 2 column 2 lt block gt lt table cell gt lt table row gt lt table body gt F
175. ic API takes much more effort Terminology Ibex uses the FO standard which defines formatting objects such as table and table cell FO makes a distinction between two types of objects block level objects broadly speaking these are objects which are formatted vertically down the page Block level objects are block block container table table and caption table and list block inline level objects these are objects whose content appears on lines within a block 2 object Commonly used inline level objects are external graphic inline leader page number page number citation and basic link Introduction 1 3 1 4 Ibex PDF Creator Developers Guide Other terminology used in XSL FO includes folio number this is the page number which is displayed on a page This is sometimes different from the physical page number If you look at this manual in a PDF viewer the physical page number is not the same as the number printed on the page because some pages such as the front cover are not included in the page number sequence About this manual This manual is split into two main sections The first covers an introduction to the use of formatting objects and an overview of various formatting objects such as tables and lists The second is a reference section listing all the available objects and attributes with many examples of their usage This manual was produced with the NET version of Ibex release 4 7 7 6 About Ibex
176. ift adjustment is shown in Figure 9 32 the first two lines are in a block which has line height shift adjustment consider shifts and so are further apart than the second two which are in a block which has line height shift adjustment disregard shifts Figure 9 32 Effect of Specifies a string on which content of cells in a table column will disregard shifts align see the section in the CSS2 Recommendation Specifies a string on which content of cells in a table rea will align see the section in the CSS2 Recommendation 9 14 2 The baseline The baseline is below the top of the text block a distance equal to 1 2 leading max ascender which places the baseline in the same place for all text elements This means that normally text rests on the same baseline regardless of the font size as shown in Figure 9 33 Figure 9 33 Text on the baseline gg gm q 4 2 leading 4 0 f descender line height 20pt baseline 1 2 leading 9 14 3 Subscript and superscript Subscripted and superscripted text is created by using the baseline shift attribute on an inline element The effect of the baseline shift is shown in Figure 9 34 where the pt characters are in an inline element with baseline shift 5pt Figure 9 34 Effect of baseline shift gm g 11 2 leading 4 0 aeie line height 3 0 pt _ baseline shift baseine descender ee 1 2 leading The FO to move a word abov
177. igure 15 15 Table with defined column widths Some cell attributes such as background color are determined using attributes from the cell itself and from the other elements of the table structure The order of precedence in determining cell characteristics such as background color is table cell table row table body table column and finally table 15 6 Proportional column widths Columns can be allocated widths which are proportional to the widths of other columns For example if we have two columns and want to give the first column twice the width Tables 85 Ibex PDF Creator Developers Guide of the second we can specify column widths using the proportional column width function as shown in Figure 15 16 The total of the values used in the proportional column width functions is 3 2 1 so the first column will gave 2 3 of the width and the second 1 3 The output from this FO appears in Figure 15 17 Figure 15 16 lt table gt FO using proportional lt table column column widths column width proportional column width 2 gt lt table column column width proportional column width 1 background color dddddd gt lt table body gt lt table row gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 1 column 1 lt block gt lt table cell gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 1 column 2 lt block gt lt table cell gt lt table row gt lt tab
178. igure 16 26 Figure 16 25 lt block container gt FO using SVG to place lt piock container space before 6pt content over text absolute position absolute top 1 6cm left Sem gt lt block gt lt instream foreign object z index 30 gt lt svg width 315 height 100 xmlns http www w3 org 2000 svg gt lt text x 30 y 60 fill blue stroke blue font size 6lpt font style italic style font family arial stroke width 0 5 gt Ibex lt text gt lt svg gt lt instream foreign object gt lt block gt lt block container gt a lt block container gt Figure 16 26 Text overlaid using This is some text which will be behind the image This is some text svg Which will be behind the image This is some text which will be behind the image This is som xt which will be behind the image This is some text which will Je aL hepigage This is some text which will be behind the ima text which will be behind the image This is so l be behind the image 16 9 Network credentials used in accessing images Ibex can retrieve images from HTTP servers as shown in Figure 16 27 below By default Ibex will do this using the credentials of the process which is creating the PDF file If Ibex is running in an ASP NET server then the default configuration is that ASP runs as the ASPNET user This user does not have permissions to access other servers and so will not be able to retrieve images from other serve
179. in Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title float footnote body static content table caption block block container inline folio suffix folio prefix inline container bidi override table cell list item label Elements and Attributes 275 Ibex PDF Creator list item body marker Attributes The following attributes can be used on this element id index class index key 276 Elements and Attributes Developers Guide 25 9 4 Ibex PDF Creator Developers Guide index range end Description This element is used to indicate the end of a range of content which has an associated index key The index will typically contain the range of page numbers between an index range begin and an index range end An index range begin index range end pair match if the ref id property of the index range end has the same value as the id property on the index range begin Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page num
180. ine height is 1 2em The em unit is proportional to the size of the current font so as the font size increases so does the line height This can be changed by setting the Settings LineHeightNormal value For instance to make the line height larger and so space text out more vertically you could use the code in Figure 9 31 Figure 9 31 FODocument doc new FODocument Changing the default line height doc Settings LineHeightNormal 1 4em 9 14 1 The effect of subscript and superscript text on line spacing When calculating the largest characters on this line we really mean those whose ascender and descender values are greatest i e futherest from the baseline When making this calculation the value of the line height shift adjustment attribute is considered If text is a subscript or superscript and so has a baseline shift value which changes its position vertically this will also change its effective ascender and descender values If line height shift adjustment consider shifts the default value then the baseline shift amount is taken into account when working out the greatest ascender and descender If line height shift adjustment disregard shifts then the effect of the baseline shift is ignored Setting line height shift adjustment disregard shifts makes lines stay the same distance apart regardless of subscript and superscript elements Text Formatting 61 Ibex PDF Creator Developers Guide The effect line height sh
181. ine space start lcm space start conditionality retain gt retain lt inline gt lt block gt Figure 9 29 Output from using 2tscard tai retain retain 60 Text Formatting Ibex PDF Creator Developers Guide 9 14 Vertical alignment The vertical alignment of blocks of text within a containing flow or block is controlled by the display align attribute The vertical alignment of words on a line is controlled by the vertical align attribute Text on a line is positioned relative to the baseline which is shown in Figure 9 30 By default text sits on the baseline In the terms of the XSL FO specification this is the alphabetic baseline Figure 9 30 The baseline gg gm g 4 2 leading 4 0 ascender line height baseline 1 2 leading The height of the font above the baseline is the ascender The height of the font below the baseline is the descender Adding the ascender and descender values for the font not for individual characters gives the font size The leading is the space above and below the characters and is the difference between the line height and the font size The XSL FO specification refers to the ascender value as the text altitude and the descender as the text depth Together these two values add up to the allocation rectangle height In these terms leading line height text altitude text depth SO 1 2 leading line height text altitude text depth 2 By default the l
182. ing the total page count so we can have page 3 of 5 is a two step process based on the use of the id attribute which uniquely identifies an FO element We place a block on the last page with the id of last page and then we use the page number citation element to get the number of the page on which that block appears as our total number of pages Typically the block with the id of last page is empty so a new page is not created at the end of the document The FO for the last block in the document is shown in Figure 4 24 and the FO to retrieve the last page number and put it in the footer is shown in Figure 4 25 Figure 4 24 Block with id for last page Figure 4 25 FO to retrieve the b f th ila page a G You can see how the id and ref id values match This is how Ibex associates the two identified block elements and knows from which block to retrieve the page number lt block id last page gt lt page number citation ref id last page gt Introduction to XSL FO 21 Ibex PDF Creator Developers Guide So bringing all these elements together we have the FO shown in Figure 4 26 Figure 4 26 lt xml version 1 0 encoding UTF 8 gt Complete FO to lt root xmlns http www w3 org 1999 XSL Format gt display total page lt layout master set gt lt simple page master master name simple count margin 2 5cm gt lt region body margin 2 5cm margin bottom 1cm region name body ba
183. ion by copying the assemblies appropriate to the NET version being used and registering them in the GAC It is not necessary to run the Ibex installer to use the Ibex assemblies on test and production machines We recommend running the installer on development machines as this will install the example files Assemblies not required in production Typically the command line programs ibex exe are not used on production servers and do not need to be installed The ibexshaping dll assemblies are used for shaping Arabic text These assemblies are loaded dynamically using reflection If your documents do not contain Arabic text then you do not need to install these assemblies 6 Installation 3 1 3 2 Chapter 3 Getting Started with Ibex Although primarily intended for use as a part of a larger application the Ibex installation includes command line programs which creates PDF files from XML XSLT and XSL FO files We will use these programs to demonstrate the basics of PDF creation with Ibex The command line programs shipped with Ibex are ibex10 exe ibex11 exe and ibex20 exe Use the one which corresponds to the version of NET you have installed Throughout this manual an XML file which uses the XSL formatting objects vocabulary is referred to as an FO file or just the FO The command line syntax for all versions is the same In these examples we use ibex20 exe Ibex command line program usage To create a PDF file from a FO
184. ional white space followed by an optional single quote or double quote character followed by a URI reference as defined in RFC2396 followed by an optional single quote or double quote character followed by optional white space followed by The two quote characters must be the same and must both be present or absent If the URI reference contains a single quote the two quote characters must be present and be double quotes This means the following are all valid values for the src attribute uri ibex jpg uri ibex jpg uri ibex jpg url http www xmlpdf com images download2 gif As the src attribute is a URL an image which exists on a web server can be downloaded automatically by Ibex as the PDF file is created This is common in real estate and catalog applications and means you do not need to make a copy of an existing image just to get it into the PDF file The FO shown in Figure 16 1 will fetch the file download2 gif from www xmlpdf com The resulting image is shown in Figure 16 2 Figure 16 1 lt bilock Sspace before 6pt gt FO to insert an image lt external graphic border l1pt solid black from a web server src url http www xmlpdf com images download2 gif content width 200 content height 200 gt lt block gt Figure 16 2 Image included from web server 16 2 The external graphic element can be used to include image files in PNG JPEG TIFF BMP and GIF forma
185. isplayed in the document depends on whether the font you are using contains the specified character If the font does not contain the specified character you will see a warning message like the one in Figure 14 3 warning 380 No glyph index found for code point 2023 in font ArialMT Lists 79 80 Lists Figure 15 1 FO for a simple 2 x 2 table Chapter 15 Tables A table in XSL FO is an area of content divided into rows and columns A table is created with the table element A FO for a simple table is shown in Figure 15 1 and the output it creates is shown in Figure 15 2 This shows the basic structure of a table element containing table body table row and table cell elements lt table gt lt table body gt lt table row gt lt table cell border l1pt solid blue padding 2pt gt lt block gt row 1 column 1 lt block gt lt table cell gt lt table cell border l1pt solid blue padding 2pt gt lt block gt row 1 column 2 lt block gt lt table cell gt lt table row gt lt table row gt lt table cell border l1pt solid blue padding 2pt gt lt block gt row 2 column 1 lt block gt lt table cell gt lt table cell border l1pt solid blue padding 2pt gt lt block gt row 2 column 2 lt block gt lt table cell gt lt table row gt lt table body gt Figure 15 2 15 1 The padding and border attributes are not inherited from containing elements so are best defined on the table cel
186. ize of the containing element Default value medium Values xx small Set the font size to the value of Settings XX_Small which defaults to 7pt x small Set the font size to the value of Settings X_ Small which defaults to 8 3pt small Set the font size to the value of Settings Small which defaults to 10pt medium Set the font size to the value of Settings Medium which defaults to 12pt large Set the font size to the value of Settings Large which defaults to 14 4pt x large Set the font size to the value of Settings X Large which defaults to 17 4pt xx large Set the font size to the value of Settings XX_Small which defaults to 20 7pt smaller Set the font size to the parent font size multipled by the value of Settings Smaller which defaults to 0 8em 338 Elements and Attributes ron AA Figure 25 87 25 11 78 Ibex PDF Creator larger lt length gt font style Description Developers Guide Set the font size to the parent font size multipled by the value of Settings Larger which defaults to 1 2em A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points This sets the font style of this element and elements it contains Typical values are show here font style italic Default value normal Values normal italic oblique inherit font weight Description The style is the same as the style of the pa
187. k gt lt flow gt lt page sequence gt lt root gt Each of the elements and attributes used in the file is explained later in the manual For now we just want to get started with using the Ibex command line program Using the command ibex20 hello creates the file hello pdf containing the text Hello World An example with XSLT translation The Ibex command line program will create a PDF file from either a an FO file or b an XML file with an XSLT stylesheet This section shows how to create a PDF file from an XML data file with an XSLT stylesheet Using Ibex without having Ibex do the XSLT transformation to create the FO is useful if you have created the FO using another tool or if you just want to manually change some FO to experiment with layout In practice XSLT is almost always part of the PDF creation process because XSL FO lacks some simple features such as being able to sequentially number headings The designers of XSL FO presumed that XSLT would be used and so did not duplicate features already in XSLT Ibex gives you the flexibility of having Ibex do the XSLT translation or having some other tool do it Internally Ibex uses the XSLT translation classes provided by NET The XSLT classes in NET 2 0 are significantly faster and use memory more efficiently than in NET 1 0 and 1 1 For this reason we recommend using NET 2 0 or later In this example we will translate some XML with an XSLT stylesheet and produce a PDF
188. l using System Xml Xs1l using System Security Policy using ibex4 using ibex4 logging namespace WebApplicationl public class pdfasp System Web UI Page private void Page_Load object sender System EventArgs e Logger getLogger setLevel Level FINEST clearHandlers try Stream stream new FileStream Server MapPath logs log txt FileMode Append FileAccess Write Logger getLogger addHandler new StreamHandler stream catch Exception FODocument doc new FODocument string dataFilePath Server MapPath data xml string templateFilePath Server MapPath template xsl stream for output in memory before sending to browser MemoryStream pdfStream new MemoryStream FileStream dataStream new FileStream dataFilePath FileMode Open FileAccess Read FileStream xslStream new FileStream templateFilePath FileMode Open FileAccess Read Logger getLogger info data file path is dataFilePath using dataStream using xslStream 36 Using Ibex with ASP NET Ibex PDF Creator Developers Guide doc generate dataStream xslStream pdfStream false Response Clear Response ContentType application pdf Response AddHeader content length System Convert ToString pdfStream Length Response BinaryWrite pdfStream ToArray Response End override protected void OnInit EventArgs e InitializeComponent
189. l elements Cell padding Padding is the amount of space that appears between the inside edge of the border of a cell and the outside edge of the content of the cell Padding is specified by the padding attribute The default amount of padding is opt Figure 15 3 shows a table with two cells The first cell has padding 1pt and the second has padding 5pt Padding is almost always used to avoid having the content too close to the cell borders Tables 81 Ibex PDF Creator Developers Guide Figure 15 3 FO showing cells with this cell has padding set to lpt so different padding 152 this cell has padding set to 5pt so the text is not so close to the edges of the cell the text is close to the edges of the cell The padding attribute sets padding for all four sides of the cell Individual sides can be set using the padding left padding right padding top and padding bottom attributes The padding attribute also supports a shorthand format where e if one value is specified padding 2pt the same value will apply to all four sides e if two values are specified padding 2pt 3pt the first value will apply to the top and bottom edges the second value to the left and right edges e if three values are specified padding 2pt 3pt 1pt the first value will apply to the top edge the second to the left and right edges and the third to bottom edge e if four values are specified padding 2pt 3pt 1pt opt t
190. last line across the whole width of page Left and right margins The margins of a block are specified using the margin left and margin right attributes The margin properties indent the edge of the paragraph by the specified amount from the edge of the containing area The FO for a block with a 2 5cm left margin is shown in Figure 9 11 lt block margin left 2 5cm gt hello world lt block gt If we nest another block inside this one as shown in Figure 9 12 the margins are cumulative The output from this FO is shown in Figure 9 13 Text Formatting 57 Ibex PDF Creator Developers Guide Figure 9 12 8 9 lt block margin left 2 5cm gt Nested blocks plock 1 lt block margin left 2 5cm gt block 2 lt block gt lt block gt Figure 9 13 Output from the above FO lollreyele iL lplloehke 2 Putting background colors on the blocks shows this more clearly The FO is in Figure 9 14 and the output is in Figure 9 15 Figure 9 14 Nested block ith lt block margin left 2 5cm background color 777777 gt este OCKs WI block 1 background color lt block margin left 2 5cm background color 999999 gt block 2 lt block gt lt block gt Figure 9 15 FO The approach to indentation defined in the XSL FO standard is that the content of two nested blocks which do not specify a margin have the same left edge The edges of the content which in our example is the text are aligned and any borders and pad
191. ld element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements page sequence master Attributes The following attributes can be used on this element master reference maximum repeats For an example showing the use of the element see Figure 25 3 162 Elements and Attributes 25 1 10 Figure 25 4 Using repeatable page master alternatives Ibex PDF Creator Developers Guide repeatable page master alternatives Description This element contains a set of conditional page master reference elements each of which specifies a page master and some conditional information When the rendering of content from a flow element triggers the creation of a new page each conditional page master reference contained in this element is evaluated to see if it should be used Typically the conditional page master reference elements are used to specify different page layouts for the first page of a sequence or for odd and even pages The Ibex manual uses this approach so that the first page of each chapter has no header Child element s This element can contain the following elements conditional page master reference one or more Parent element s This element can be contained in the following elements page sequence master Attributes The following attributes can be used on this element maximum repeats For an example sho
192. le borders a bottom not have a border bottom border With the collapsed border model the border between the two cells will be half the width it is in the separate model as shown in Figure 15 25 Figure 15 25 Collapsed borders this cell has this cell does a bottom not have a bottom border border Figure 15 26 shows an example of a table with separate borders Note how the border spacing on the previous table sets the space between cells only not the space between the cell and the table border This space can be set using padding If we add padding 2mm to the table we get the layout shown in Figure 15 27 Figure 15 26 borders Figure 15 27 Cells separated from the table borders by rons Tee padding cell three cell four 15 9 Table headers Table headers are created using the table header element The table header should appear inside the table element after any table column elements and before any table body elements The table header element is similar in structure to a table body element in that it contains table row elements 88 Tables Figure 15 28 Simple table with Ibex PDF Creator Developers Guide This section describes the behavior of table headers which do not change Headers which can have different content on different pages are described later in this chapter in the section on continuation markers on page 91 Figure 15 28 shows the FO for a simple table with a one row header and two content rows
193. le row gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 2 column 1 lt block gt lt table cell gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 2 column 2 lt block gt lt table cell gt lt table row gt lt table body gt Figure 15 17 example 15 7 Spanning columns and rows The number of columns which a cell spans is set by the number columns spanned attribute An example FO for this is shown in Figure 15 18 In this example the first cell of the first row spans two columns The output from this FO appears in Figure 15 19 Figure 15 18 8 5 lt table gt FO for cell spanning2 lt table column column width 30 gt columns lt table column column width 70 background color dddddd gt lt table body gt lt table row gt lt table cell border 1pt solid blue padding 2pt number columns spanned 2 gt lt block gt row 1 column 1 lt block gt lt table cell gt lt table row gt lt table row gt lt table cell border 1pt solid blue padding 2pt gt lt block gt row 2 column 1 lt block gt lt table cell gt lt table cell border 1pt solid blue padding 2pt gt lt block gt row 2 column 2 lt block gt lt table cell gt lt table row gt lt table body gt 86 Tables Ibex PDF Creator Developers Guide Figure 15 19 Cell spanning two row 1 column 1 columns Figure 15 20 FO for cell spanning two rows The n
194. led Ibex PDF Creator Professional Edition The installation process installs these NET assemblies used by Ibex NET Version Assembly Description 1 0 32bit ibex1o dll Main Ibex assembly ibex10 exe Ibex command line utility Installation 5 2 3 2 4 Ibex PDF Creator Developers Guide NET Version Assembly Description 1 1 32bit ibext1 dll Main Ibex assembly ibex11 exe Ibex command line utility ibexshaping11 dll Provides Arabic text shaping support 2 0 32bit ibex20 dll Main Ibex assembly ibex20 exe Ibex command line utility ibexshaping20 dll Provides Arabic text shaping support 2 0 64bit ibex20 64 dll Main Ibex assembly ibex20 64 exe Ibex command line utility ibexshaping20 64 dll Provides Arabic text shaping support 3 5 32bit ibex35 dll Main Ibex assembly ibex35 exe Ibex command line utility ibexshaping35 dll Provides Arabic text shaping support 3 5 64bit ibex35 64 dll Main Ibex assembly ibex35 64 exe Ibex command line utility ibexshaping35 64 dll Provides Arabic text shaping support 4 0 32bit ibex4o dll Main Ibex assembly ibex40 exe Ibex command line utility ibexshaping4o dll Provides Arabic text shaping support 4 0 64bit ibex40 64 dll Main Ibex assembly ibex40 64 exe Ibex command line utility ibexshaping40 64 dll Provides Arabic text shaping support Installing by copying files Ibex can be installed as part of a larger applicat
195. lement and not have any table row elements In this case the formatter determines formation of rows by looking for ends row and starts row attributes on each table cell If a table cell ends the row then the ends row attribute should be set to true otherwise it should be set to false or not used at all A table which has two rows of three cells each and is created without row elements looks like this lt table gt lt table body gt lt table cell starts row true gt col 1 lt table cell gt lt table cell gt col 2 lt table cell gt lt table cell ends row true gt col 3 lt table cell gt lt table cell starts row true gt col 1 lt table cell gt lt table cell gt col 2 lt table cell gt lt table cell ends row true gt col 3 lt table cell gt lt table body gt lt table gt Default value false Values false This cell does not start a new row true This cell starts a new the row table layout Description This attribute controls whether the layout of a table which means the column widths is calculated from the content of the cells or from table column elements Use fixed to calculate column widths from table column elements This is the recommended approach It is faster and makes the output file look consistent when using different data Default value auto Elements and Attributes 367 25 11 137 25 11 138 25 11 139 Ibex PDF Creator Developers Guide Values auto fixed see above tabl
196. level formatting objects The objects described in this section are used to contain text and other block level and inline level elements 186 Elements and Attributes 25 2 1 Figure 25 6 Figure 25 7 Figure 25 8 Ibex PDF Creator Developers Guide block Description This element is the main container for text content The simplest block element looks like this lt block gt this is text lt block gt The block is a block level element The other block level elements are table table and caption list block and block container A block element can contain other block level elements as well as text A typical usage would be to insert an empty block into a paragraph of text to cause a line break like this lt block gt this will be line 1 lt block gt lt block gt lt block gt this will be line 2 lt block gt Another use of nested blocks is to keep two other block level objects together by using the keep together attribute on the previous block like this lt block keep together always gt lt block gt this will be line 1 lt block gt lt block gt this will be line 2 lt block gt lt block gt To keep a block together and prevent it being split by a page break use the keep together attribute To keep a block with the block following it use the keep with next attribute To keep a block with the block before it use the keep with previous attribute To format a block of text retaining line feeds which were
197. llapsed into a single border If the value is separate then table row and cell borders are all drawn separately one inside the other The default value for border collapse is collapse To create the kind of borders used in CSS where the cell borders appears inside the row and table borders set border collapse to separate Child element s This element can contain the following elements table body one or more table column zero or more table footer zero or one table header zero or one Parent element s This element can be contained in the following elements wrapper basic link float footnote body static content table and caption table caption Elements and Attributes 233 Ibex PDF Creator block block container inline inline container bidi override table cell list item label list item body marker Attributes Developers Guide The following attributes can be used on this element background attachment background image background position horizontal border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left 234 Elements and Attributes background color background repeat background position vertical border before c
198. lopers Guide 16 8 Transparent Images 16 8 1 Transparent GIF images GIF images which have transparent areas are supported The FO in Figure 16 17 places the same transparent GIF image on two different backgrounds The output from this FO is shown in Figure 16 18 Figure 16 17 lt block background color blue gt FO for transparent lt external graphic src url ibm logo gif content height 2cm gt image lt block gt lt block background color black gt lt external graphic srce url ibm logo gif content height 2cm gt lt block gt Figure 16 18 Transparent GIF images f TL Whi aj TL 16 8 2 Transparent PNG images PNG images which have transparent areas are supported The FO in Figure 16 19 places a transparent PNG image on a white backgrounds The output from this FO is shown in Figure 16 20 Figure 16 19 lt block background color white gt FO for transparent lt external graphic src url RedbrushAlpha 0 25 png content height 2cm gt image lt block gt Figure 16 20 Transparent PNG image 16 8 3 Transparent images using masking Ibex can use image masking to make some parts of an image appear transparent This is an extension to the XSL FO standard Image masking works by defining colors from the image which should not be displayed The PDF viewer will compare each pixel in the image with the mask and not display 102 Images Ibex PDF Creator Developers Guide pixels which
199. lor gt A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color lt border width gt Can be any of the values thin A thin border The actual default width is Settings BorderWidthThin and so can be changed programatically medium A medium border The actual default width is Settings BorderWidthMedium and so can be changed programatically thick A thick border The actual default width is Settings BorderWidthThick and so can be changed programatically lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points lt border style gt Can be any of the values none No border solid A single solid line this is 1pt solid black double Two lines separated by a gap The gap is 1 3 of the width of the border this is 4pt black double dashed see example this is 2pt black dashed SEE a dotted See o Elements and Attributes 309 25 11 32 Figure 25 41 25 11 33 Figure 25 42 Ibex PDF Creator inset outset groove ridge inherit border left color Description Developers Guide The top and left borders are slightly darker then the required color and the bottom and right borders are slightly lighter this is 2pt blue inset See example this is 2pt blue outset See example See example Sets the left border color For example border left color red D
200. lt value This attribute has no default value you must provide a value Elements and Attributes 365 25 11 133 25 11 134 Ibex PDF Creator Developers Guide start indent Description This attribute sets indentation of content from the start edge of the containing area For non rotated content the start edge is the left edge This attribute sets the indentation of the content contained in the element The content will be positioned the required distance from the right edge of the containing area and any padding and border will then be placed outside the content For CSS style alignment of nested elements use the margin left and margin right attributes instead of start indent and end indent Default value opt Values auto lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit starting state Description Specifies if a bookmark entry should be open with its child bookmarks visible when the PDF file is opened Default value show Values inherit show hide 366 Elements and Attributes 25 11 135 Figure 25 119 25 11 136 Ibex PDF Creator Developers Guide starts row Description Within a table body or table header and table footer element a table has table cell elements Normally cells are placed inside a table row element but it is possible to place the cells directly below the table body e
201. mage shows rectangles using the same gradient in conjunction with gradientUnits objectBoundingBox lt xml version 1 0 standalone no gt lt svg width 8cm height 3cm viewBox 0 0 1000 450 version 1 1 xmlns http www w3 org 2000 svg gt lt g gt lt defs gt lt linearGradient id linear_objectBoundingBox x1l 0 y1 0 x2 1 y2 1 gt lt stop offset 5 stop color ff0000 gt lt stop offset 95 stop color 0000ff gt lt linearGradient gt lt defs gt lt rect fill none stroke blue x 1 y 1 width 990 height 440 gt lt g transform translate 10 50 gt lt rect fill url linear_userSpaceOnUse x 10 y 10 width 600 height 100 gt lt rect fill url linear_userSpaceOnUse x 200 y 120 width 600 height 100 gt lt g gt lt g gt lt svg gt producing this image Scalable Vector Graphics SVG images 119 17 8 Ibex PDF Creator Developers Guide Radial gradients Radial gradients are supported from version 5 7 6 onwards The interpretation of the values specified for the coordinates cx cy r fx fy of the radialGradient element changes depending on value specified for gradientUnits When gradientUnits userSpaceOnUse the specified values are in user space which is the space defined by the prevailing lt g gt element The specified coordinates are relative to the prevailing lt g gt element so two elements which use the same gradient
202. marker Attributes Developers Guide The following attributes can be used on this element 212 background attachment background image background position horizontal border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left margin margin bottom margin left bottom right alignment adjust baseline shift Elements and Attributes background color background repeat background position vertical border before color border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right margin top margin right relative position top left alignment baseline block progression dimension Ibex PDF Creator color dominant baseline id index key keep together keep with previous overflow width Developers Guide display align height index class inline progression dimension keep with next line height reference orientation writing mode Elements and Attributes 213 25 3 8 Figure 25 10 Figure 25 11 Ibex PDF Cr
203. match the mask effectively making these pixels transparent and so leaving visible the content behind the image The image mask is defined using the lt ibex mask gt element which must be contained within an external graphic element as shown in Figure 16 21 Figure 16 21 i k lt external graphic src url ixsl jpg z index 10 gt FO to mask an image lt ipex mask red min 255 red max 255 green min 255 green max 255 blue min 255 blue max 255 gt lt external graphic gt To use the ibex mask element you must reference the ibex namespace in your FO as shown in Figure 16 22 Figure 16 22 lt root Referencing the ibex xmins fo http www w3 org 1999 XSL Format namespace xmlns ibex http www xmlpdf com 2003 ibex Format gt The mask defines the minimum and maximum values for each of the red green and blue components of an image A mask using these values is applicable only to images which are in RGB format with 24 bits per pixel For CMYK images attributes called c min c max m min m max y min y max k min and k max define the minimum and maximum values for each of the cyan magenta yellow and black components of the image The image mask shown above causes any pixel which has red 255 green 255 and blue 255 to not be rendered As a pixel with red green and blue all equal to 255 is white this means any white pixels will not be rendered Figure 16 23 shows some text over which we have placed an imag
204. mber prefix Description This element is used to specify a prefix for page numbers created using an index key reference element Child element s This element can contain the following elements text basic link zero or more bidi override zero or more character zero or more external graphic zero or more float one or more cannot be used inside an out of line element footnote one or more cannot be used inside an out of line element index page citation last zero or more index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element inline zero or more inline container zero or more instream foreign object zero or more leader zero or more page number zero or more page number citation zero or more page number citation last zero or more retrieve marker one or more subject to constraints specified for this element scaling value citation zero or more wrapper one or more subject to constraints specified for this element Parent element s This element can be contained in the following elements index key reference Elements and Attributes 273 25 9 2 Ibex PDF Creator Developers Guide index page number suffix Description This element is used to specify a suffix for page numbers created using an index key reference element Child element s This element can contain the following elements
205. more cannot be used inside an out of line element index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element list block zero or more retrieve marker one or more subject to constraints specified for this element table zero or more table and caption zero or more wrapper one or more subject to constraints specified for this element Parent element s This element can be contained in the following elements page sequence Attributes The following attributes can be used on this element id index class Elements and Attributes 177 Ibex PDF Creator Developers Guide index key flow name For an example showing the use of the element see 178 Elements and Attributes 25 1 20 Ibex PDF Creator Developers Guide title Description The title element associates a string title with a page sequence This has no function when generating PDF so is discarded by Ibex Child element s This element can contain the following elements text basic link zero or more bidi override zero or more character zero or more external graphic zero or more float one or more cannot be used inside an out of line element footnote one or more cannot be used inside an out of line element index page citation last zero or more index range begin one or more subject to constraints specified for this element index range e
206. n This element is used to include an image into the document This is an inline element so it must be contained in a block element The image source is defined by the src attribute The src attribute is called a uri specification and must follow the following rules A sequence of characters that is url followed by optional white space followed by an optional single quote or double quote character followed by a URI reference as defined in RFC2396 followed by an optional single quote or double quote character followed by optional white space followed by The two quote characters must be the same and must both be present or both be absent If the URI reference contains a single quote the two quote characters must be present and be double quotes This means the following are all valid values for the src attribute uri ibex jpg uri ibex jpg uri ibex jpg url http www xmlpdf com images downloadz2 gif To set the size of the image use the content height and content width attributes Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title 202 Elements and Attributes Ibex PDF Creator block inline folio suffix folio prefix bi
207. n inches mm millimetres em current font size in points linefeed treatment Description This sets the way in which linefeeds in the FO appear in the output By default linefeeds are treated as spaces only See page 69 for a detailed example of the effects of this attribute Default value treat as space Values treat as space Linefeeds in the FO become spaces in the output preserve Linefeeds in the FO become linefeeds in the output line height Description Sets the height of a line Percentage values refer to the current font size Default value normal Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points normal Line height is 1 2 times the font size 346 Elements and Attributes 25 11 93 Figure 25 94 Figure 25 95 Figure 25 96 Figure 25 97 Ibex PDF Creator Developers Guide margin Description This is a shorthand way of setting margin top margin bottom margin right and margin left To set all margins to the same size use a single value like this margin 1pt If there are two values the top and bottom margins are set to the first value and the side margins are set to the second like this margin 1pt 3pt If there are three values the top margin is set to the first value the side margins are set to the second and the bottom is set to the third like this margin 1pt 2pt
208. n Figure 22 6 Figure 22 5 g gt lt block xmlns ibex http www xmlpdf com 2003 ibex Format gt FO using ibex version created with Ibex version lt ibex version gt lt block gt Figure 22 6 Output from ibex version created with Ibex version 4 7 7 6 22 8 PDF X Ibex can create PDF files which comply with the PDF X standard This is described in detail on page 143 22 9 Viewer Preferences Ibex can set flags on the PDF file which control how the viewer application such as Acrobat Reader will display the PDF file These flags are set using the ibex viewer preferences element as shown in Figure 22 7 Figure 22 7 8 7 lt root xmlns http www w3 org 1999 XSL Format FO using the xmlns ibex http www xmlpdf com 2003 ibex Format gt ibex viewer lt ibex viewer preferences hide toolbar true gt preferences element The attributes for the ibex viewer preferences element are hide toolbar true Set to true to hide the viewer application s false tool bars hide menubar true Set to true to hide the viewer application s false menu bar hide window ui true Set to true to hide the UI and just display false the document content fit window true Set to true to resize the viewer window to false fit the document page size Extensions 141 Ibex PDF Creator Developers Guide Cc OOO center window true Set to true to center the viewer window false on the screen display doc title true Set to true to have the
209. n each one If the list to be kept together exceeds the size of the region in which they are being placed they will not be kept together Default value auto leader length Description This sets the length of a leader element This can be set as three components for the minimum optimum and maximum values like this 344 Elements and Attributes Figure 25 92 Figure 25 93 25 11 89 25 11 90 Ibex PDF Creator Developers Guide leader length mimimum 10pt leader length optimum 50 leader length maximum 100 Or alternatively all three components can be set to the same value like this leader length 100 The default values for each component are leader length mimimum opt leader length optimum 12pt leader length maximum 100 Default value see description leader pattern Description This sets the appearance of a leader element Default value space Values space The leader will be blank This is useful for justification of text dots The leader will be a dotted line rule The leader will be a solid line left Description When used on an absolutely or relatively positioned element this sets the offset from the left edge of the container to the left edge of this element Elements and Attributes 345 20 11 91 29 11 92 Ibex PDF Creator Developers Guide Default value auto Values lt length gt A length such as 10cm Valid units are pt points cm centimetres i
210. n left space after end indent bottom right border after precedence border start precedence id index key As described in section 6 7 7 of the XSL FO specification only the background properties from this set apply If the value of border collapse on the table is collapse or collapse with precedence the border properties also apply 244 Elements and Attributes 25 4 7 Ibex PDF Creator table body Description Developers Guide This element is a container for table row and table cell elements A single table element can contain multiple table body elements which are output in the order in which they appear in the XML Child element s This element can contain the following elements table cell zero or more table row zero or more Parent element s This element can be contained in the following elements table Attributes The following attributes can be used on this element background attachment background image background position horizontal border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color background color background repeat background position vertical border before color border before width border after style border start color border start width border end style border top bo
211. n right 1pt Default value opt Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit margin top Description Sets the top margin on an element For example margin top 1pt Default value opt Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit marker class name Description Sets the name for a marker which is then used on a retrieve marker element to retrieve the content contained in that marker See marker for an example Default value This attribute has no default value you must provide a value Elements and Attributes 349 20 17 99 25 11 100 25 11 101 25 11 102 Ibex PDF Creator Developers Guide master name Description This is a unique name given to a simple page master or page sequence master and then used as the master reference attribute of a page sequence to specify which page master will be used to lay out the content of the page sequence Default value This attribute has no default value you must provide a value master reference Description Both simple page master and page sequence master have a unique master name attribute which is used as the master reference attribute of a page sequence to specify which page master will be used to lay out the conte
212. name body background color eeeeee column count 3 gt lt simple page master gt lt layout master set gt lt page sequence master reference simple gt lt flow flow name body gt lt block gt Hello World lt block gt lt flow gt lt page sequence gt lt root gt Default value 1 Values lt integer gt A non negative integer Sets the number of columns to this value column gap Description Sets the gap between columns in a body region with column count gt 1 Only the body region can have more than one column 328 Elements and Attributes Ibex PDF Creator Developers Guide For example to create a body region with two columns separated by a 4cm gap set column count to 2 and column gap to 4cm like this Figure 25 69 lt xml version 1 0 encoding UTF 8 gt lt root xmlns fo http www w3 org 1999 XSL Format gt lt layout master set gt lt simple page master master name simple gt lt region body margin 2 5cm region name body column count 2 column gap 4cm gt lt simple page master gt lt layout master set gt lt page sequence master reference simple gt lt flow flow name body gt lt block gt Hello World lt block gt lt flow gt lt page sequence gt lt root gt Default value 12 0pt Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points 25 11 61 column
213. name attribute Within the region all of the content can be aligned to the top bottom or middle of the region using the display align attribute The content of the region can be rotated using the reference orientation attribute Unlike the region body element the region before does not have margin properties The size of the region is defined using the extent attribute By default the before region is reduced in width by the presence of the region start and region end elements This can be changed by setting the precedence attribute to true Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements simple page master Attributes The following attributes can be used on this element background attachment background color background image background repeat background position horizontal background position vertical border border before color border before style border before width border after color border after style border after width border start color border start style border start width border end color border end style border end width border top 168 Elements and Attributes Ibex PDF Creator border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left
214. nd one or more subject to constraints specified for this element inline zero or more inline container zero or more instream foreign object zero or more leader zero or more page number zero or more page number citation zero or more page number citation last zero or more retrieve marker one or more subject to constraints specified for this element scaling value citation zero or more wrapper one or more subject to constraints specified for this element Parent element s This element can be contained in the following elements page sequence Elements and Attributes 179 25 1 21 Ibex PDF Creator Developers Guide flow map Description The flow map is used to specify the assignment of flows to regions Using the flow map the content from one or more flow elements can be assigned to appear in one or more regions So content from one flow can be rendered across multiple regions on the same page filling one region then another flow map elements must have a unique flow map name value This is referenced by the flow map reference attribute of a page sequence to assign the content of that page sequence using the named flow map flow maps were added to XSL FO in version 1 1 Child element s This element can contain the following elements flow assignment zero or more Parent element s This element can be contained in the following elements layout master set Attributes The following attributes can b
215. ng attributes can be used on this element id index class index key keep together For an example showing the use of the element see Elements and Attributes 257 25 5 4 Ibex PDF Creator Developers Guide list item label Description This element contains the label part of a list item The list item label contains block level elements it does not itself contain text The list item label should always have its end indent attribute set to label end which is a function returning a value calculated from the provisional distance between starts and provisional label separation attributes If the end indent is not so specified the label column will overlap the body column The list item body should always have its start indent attribute set to body start which is a function returning a value calculated from the provisional distance between starts and provisional label separation attributes If the start indent is not so specified the label column will overlap the body column Child element s This element can contain the following elements block zero or more block container zero or more float one or more cannot be used inside an out of line element index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element list block zero or more retrieve marker one or more subject to constraints specified for this element ta
216. ng elements root Attributes The following attributes can be used on this element starting state For an example showing the use of the element see Figure 25 18 lt bookmark tree gt lt bookmark internal destination section 1 gt lt bookmark title gt Chapter 1 lt bookmark title gt lt bookmark internal destination section 1 1 gt lt bookmark title gt Section 1 lt bookmark title gt lt bookmark gt lt bookmark internal destination section 1 2 gt lt bookmark title gt Section 2 lt bookmark title gt lt bookmark gt lt bookmark gt lt bookmark internal destination section 2 gt lt bookmark title gt Chapter 2 lt bookmark title gt lt bookmark internal destination section 2 1 gt lt bookmark title gt Section 1 lt bookmark title gt lt bookmark gt lt bookmark gt lt bookmark tree gt 264 Elements and Attributes 25 2 Ibex PDF Creator bookmark Description Developers Guide This creates a single bookmark which links to a place in the PDF file The destination in the PDF file is created by giving some formatting object an id attribute then setting the internal destination attribute on the bookmark to the value specified in the destination id Child element s This element can contain the following elements bookmark zero or more bookmark title exactly one Parent element s This element can be contained in the following elements bookmark tree bookmark
217. no width can be found then the width of the float is calculated from by multplying the containing block width by Settings SideFloatDefaultWidthPercentage which defaults to 30 68 Floats Chapter 12 Space Handling XSL FO defines various attributes for managing whitespace in FO These allow you to control how linefeeds and whitespace are output 12 1 Linefeeds and carriage returns A linefeed is a character with ASCII code 10 or Unicode code point U 000A This is different to a carriage return which has ASCII code 13 Ibex acts on linefeeds not on carriage returns Carriage returns are ignored during PDF creation 12 2 Default treatment of linefeeds and spaces By default linefeeds and whitespace preceding and following linefeeds are removed during formatting Figure 12 1 shows FO which has linefeeds at the end of each line The resulting output shown in Figure 12 2 has neither linefeeds nor spaces around the text This is the default treatment for text in XSL FO Figure 12 1 f lt block margin 2cm gt To be or not to be that is the question Text with linefeedS Whether tis nobler in the mind to suffer and spaces The slings and arrows of outrageous fortune Or to take arms against a sea of troubles lt block gt Figure 12 2 Output with default handling To be or not to be that is the question Whether tis nobler in the mind to suffer The slings and arrows of outrageous fortune Or to take arms against a sea of t
218. not be effectively used the size of the block containing the image is determined from the size of the image at the time the image is processed the size of the containing block is unknown Summary of supported elements This section briefly documents the degree to which SVG elements are supported in Ibex It is not an SVG manual Information on the SVG specification can be found at http www w3 org TR SVG11 expanded toc html Animation of SVG elements using javascript is not supported lt svg gt The lt svg gt element is used to define the size and shape of the image using the width and height attributes and to establish a new coordinate system using the viewBox attribute lt g gt The lt g gt element used to move the coordinate system using the transform attribute Supported transform operations are Operation Effect translate x y translate the coordinate system x units horizontally and y units vertically translate x translate the coordinate system x units horizontally and zero units vertically matrix a b c d e f multiply the current transformation matrix by the one specified scale x y scale the coordinate system x units horizontally and y units vertically rotate angle rotate the coordinate system angle degrees about the origin rotate angle x y rotate the coordinate system angle degrees about the point x y skewX angle skew the coordinate system angle degrees along the X axis skewY angle
219. nt of the page sequence Default value This attribute has no default value you must provide a value number columns repeated Description This is used on a table column element to indicate how many columns the table column element applies to Default value number columns spanned Description This is used on a table cell element to specify how many columns the cell spans This is functionally similar to the HTML colspan attribute 350 Elements and Attributes 25 11 103 25 11 104 25 11 105 Ibex PDF Creator Developers Guide Default value number rows spanned Description This is used on a table cell element to specify how many rows the cell spans This is functionally similar to the HTML rowspan attribute Default value orphans Description This specifies the number of lines of text which must appear in a paragraph before a page break At the default setting of 2 a single line will never appear by itself at the bottom of a page If there is room for only a single line on a page and the paragraph has more than one line the whole paragraph will be shifted to the next page Increasing the value increases the number of lines which must appear on a page before a page break See also widows Default value overflow Description This attribute determines whether content which exceeds the size of an element should be displayed or not An example of this is the fixed size region elements such as r
220. ntent will not appear Child element s This element can contain the following elements A block one or more Parent element s This element can be contained in the following elements page sequence Attributes The following attributes can be used on this element id index class index key flow name 176 Elements and Attributes 25 1 19 Ibex PDF Creator Developers Guide static content Description This element is used to create content in a region other then the body region The term static refers to the fact that the content will go only on the current page unlike the content of a flow element that may extend to many pages Static content is commonly used for page headers and footers The content is usually different on each page as the page number changes The flow name attribute may correspond to a region name used on a non body region of the current page master Which page master this corresponds to is determined by the master reference attribute of the containing page sequence If the flow name does not match a region name the content will not appear This makes it possible to have a page sequence which contains many static content elements each matching a different page layout Only the static content which matches a region which is on the current page layout will be displayed Child element s This element can contain the following elements block zero or more block container zero or more float one or
221. number Description This is used on a table column element to specify which column the table column element refers to This attribute is optional as the column number can be determined from the position of the table column element in the list of such elements Figure 25 70 ee lt table column column number 1 column width 20 gt lt table column column number 2 column width 30 gt lt table column column number 3 column width 50 gt lt table body gt lt table row gt lt table cell gt col 1 lt table cell gt lt table cell gt col 2 lt table cell gt lt table cell gt col 3 lt table cell gt lt table row gt lt table body gt lt table gt Elements and Attributes 329 25 11 62 Figure 25 71 25 11 63 Ibex PDF Creator Developers Guide Default value current column number column width Description This is used on a table column element to specify the width of the column the table column element refers to For example to set the widths of three columns to 20 30 and 50 you would do this lt table gt lt table column column number 1 column width 20 gt lt table column column number 2 column width 30 gt lt table column column number 3 column width 50 gt lt table body gt lt table row gt lt table cell gt col 1 lt table cell gt lt table cell gt col 2 lt table cell gt lt table cell gt col 3 lt table cell gt lt table row gt lt table body gt l
222. olor border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right Ibex PDF Creator font family font size font size adjust font variant margin margin bottom margin left space after end indent bottom right block progression dimension border before precedence border end precedence border start precedence break before id index key intrusion displace keep together keep with previous table omit header at break width Developers Guide font selection strategy font stretch font style font weight margin top margin right space before start indent relative position top left border after precedence border collapse border separation break after clear index class inline progression dimension height keep with next table layout table omit footer at break writing mode Elements and Attributes 235 Ibex PDF Creator Developers Guide 25 4 3 table column Description This element is used to specify characteristics for columns in a table such as the background color and the width A table would typically have multiple table column elements looking something like this Figure 25 13 Sie lt table column column width 20 gt lt table column column width 30 gt
223. ont family arial gt Using the font weight hello lt inline font weight bold gt world lt inline gt attribute lt block gt Figure 9 8 Using font weight hello world 9 5 Text size The size of text is set using the font size attribute The font size specifies the size of the font and can be specified in a number of ways listed below 54 Text Formatting 9 6 lt W 9 8 Ibex PDF Creator Developers Guide A numeric size The most common approach is to specify the size you want in points for example font size 12pt or font size 30pt An absolute size Attribute Value A relative size This sets the font size based on the size of the prevailing font Attribute Value Size existing size 1 2 existing size 1 2 Another way of setting the font size relative to the current font size is to use the em unit 1 0em is the current font size so 2 0em specifies a size which is twice as big as the current size Underlining text Text is underlined using the text decoration attribute Specifying text decoration underline will cause text to be underlined like this Striking out text You can strike out text using the text decoration attribute Specifying text decoration line through will cause text to be underlined like this Horizontal alignment Horizontal alignment is specified using the text align attribute The default alignment is left Valid values for text
224. ont stretch font style font weight margin top margin right relative position top left direction index class letter spacing score spaces word spacing 2002 Ibex PDF Creator Developers Guide character Description This element is used to insert a single character into the content Given that modern XML editors can insert all Unicode characters there is little requirement to use this element Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title block inline folio suffix folio prefix bidi override marker Attributes The following attributes can be used on this element background attachment background color background image background repeat background position horizontal background position vertical border border before color border before style border before width Elements and Attributes 197 Ibex PDF Creator border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left font family font size font
225. ontaining area but in XSL 1 1 this has been clarified to mean the containing reference area Positioning block containers It is important to realise that block containers are not positioned relative to the containing block Figure 18 1 shows FO with two absolutely positioned block containers Both block containers will be positioned relative to the containing region because the region is the containing reference area As they both have the same top attribute they will both be positioned in the same place lt flow flow name body gt lt block gt some text lt block container absolute position absolute height 2cm top 3cm gt lt block gt in block container one lt block gt lt block container gt lt block gt lt block gt some more text lt block container absolute position absolute height 2cm top 3cm gt lt block gt in block container two lt block gt lt block container gt lt block gt lt flow gt The simplest way to position a block container is to place it inside another block container which does not have the absolute position attribute FO for doing this is shown in Figure 18 2 The outer block container is not absolutely positioned and will be Absolute Positioning 123 Ibex PDF Creator Developers Guide placed in the normal flow of content The inner block container is absolutely positioned relative to the outer one Figure 18 2 a lt flow flow name body gt Positioneda lt piock
226. oose one of the markers in that class See marker for a complete example Default value This attribute has no default value you must provide a value retrieve position Description This attribute is used on a retrieve marker to specify which marker is to be retrieved The retrieve class name attribute specifies which class of marker is retrieved and the retrieve boundary and retrieve position attributes are used to choose one of the markers in that class See marker for a complete example Default value first starting within page 360 Elements and Attributes 20 11 1268 25 11 127 Ibex PDF Creator Developers Guide Values first starting within Use the first marker which appears starts on this page page first including Use the first marker which has any content on this page carryover last starting within page last ending within page right Description For an absolutely positioned element this specifies the distance between the right edge of the containing element and the right edge of this element Default value auto rule thickness Description This is used on the leader element to specify the thickness i e height of the line the leader creates Default value 1pt Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points Elements and Attributes 361 25 11 128 25 11 129 Figure 25 11
227. opened with the correct owner password the user has total control of the document deny print true If this is set to true a user who opens the false document with the user password will not be able to print the document deny print high true If this is set to true a user who opens the resolution false document with the user password will not be able to print a high resolution copy of the document They will only be able to print a low resolution 150dpi version If deny print true this attribute has no effect and the document cannot be printed deny extract true If this is set to true a user who opens the false document with the user password will not be able to use cut and paste functionality to copy part of the document deny modify true If this is set to true a user who opens the false document with the user password will not be able to modify the document but can still assemble it See deny assembly below deny assembly true If deny modify true and false deny assembly false then the user cannot change the document but can assemble it which means insert rotate or delete pages and create bookmarks or thumbnail images Setting deny modify true and deny assembly true prevents assembly Setting any of the attributes listed above will cause Ibex to encrypt the document Extensions 137 Ibex PDF Creator Developers Guide Specifying the user password but not the owner password will set the owner password to the
228. operty of the document Separate individual keywords with commas creator Specifies a string which becomes the creator property of the document This should be the name of the application which created the XSL FO document from which the PDF file was created 138 Extensions Ibex PDF Creator Developers Guide page mode Specifies how Acrobat will display the document when it is first opened If set to bookmarks then if the document has bookmarks they will be displayed If set to thumbs then the thumbnails tab in Acrobat will be displayed If set to fullscreen the document will be displayed without any toolbar border etc Following the PDF standard the document creator property should be the name of the product which converted the content to PDF format so this is always Ibex Other document properties such as creation and modification date are populated automatically by Ibex 22 3 Custom Document Properties Acrobat supports the display and editing of custom document properties These properties are a set of name value pairs stored within the PDF file In Acrobat 6 0 these properties can be viewed by using the File Document Properties menu option and clicking on the Custom entry in the list box to display a screen like this Document Properties Advanced p Custom Properties Custom Description Name favourite color Fonts Initial View Value blue favourite color blue You can add custom
229. or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element inline zero or more inline container zero or more instream foreign object zero or more leader zero or more page number zero or more page number citation zero or more page number citation last zero or more retrieve marker one or more subject to constraints specified for this element scaling value citation zero or more wrapper one or more subject to constraints specified for this element Parent element s This element can be contained in the following elements page sequence Elements and Attributes 225 25 3 13 Ibex PDF Creator Developers Guide folio suffix Description This element is used create a suffix which appears after the page number inserted by page number page number citation and page number citation last Child element s This element can contain the following elements text basic link zero or more bidi override zero or more character zero or more external graphic zero or more float one or more cannot be used inside an out of line element footnote one or more cannot be used inside an out of line element index page citation last zero or more index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element inline zero or more
230. order end style Elements and Attributes 239 Ibex PDF Creator border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left relative position top left height index class inline progression dimension keep together 240 Elements and Attributes Developers Guide border top border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right bottom right block progression dimension id index key intrusion displace width 25 4 5 Ibex PDF Creator Developers Guide table header Description This element creates a header which appears once at the top of the table and is then repeated after each page break To prevent this repetition set table omit header at break to true on the containing table A table header is itself a table and contains rows and cells in the same manner as table element Child element s This element can contain the following elements table cell zero or more table row zero or more Parent element s This element can be contained in the following elements table Attributes The following attributes can be used on this element background attachment background color background image background repeat
231. ose_stream is true the PDF stream will be closed after the PDF file is generated if false it will not By default the stream is closed Not closing the stream is useful if you are generating to a MemoryStream object as the bytes cannot be read from the MemoryStream if it has been closed Using Ibex 31 6 2 5 5 2 4 Ibex PDF Creator Developers Guide Generating a PDF from XML and XSL These methods take XML an XSLT stylesheet and a stream to write the resulting PDF file to public void generate Stream xml_stream Stream xsl_stream Stream pdf_stream public void generate Stream xml_stream Stream xsl_stream Stream pdf_stream bool closeStream Ibex uses the NET XSLT processor to transform the XML using the specified stylesheet and passes the resulting FO to the PDF creation routines XSLT transformation is faster or more efficient in NET 2 0 and later and we recommend using this version or later if possible Generate a PDF from XML and XSL with parameters These methods are similar to the ones in the previous section but take an additional hashtable which if not null should contain name value pairs which are then passed as arguments to the XSLT translation process public void generate Stream xml_stream Stream xsl_stream Stream pdf_stream bool close_stream Hashtable params 32 Using Ibex Chapter 6 Using Ibex with ASP NET This chapter shows how to use Ibex with ASP NET including how to create a PDF file an
232. ottom and left edges in that order The following attributes can be specified to set each side explicitly bleed top width bleed bottom width bleed right width bleed left width 23 3 Trim box The TrimBox size defaults to the BleedBox size The TrimBox can be specified as a change from the BleedBox by specifying the ibex trim width attribute on the simple page master This attribute specifies the distance by which the TrimBox is smaller than the BleedBox as shown in Figure 23 3 Figure 23 3 lt simple page master page height 313mm page width 22 6mm Setting the trim box master name page ibex trim width 3mm gt size 144 PDF X 23 4 Figure 23 4 Setting the overprint mode Ibex PDF Creator Developers Guide If one value is used it applies to all sides of the page if two values are used the top and bottom edges use the first value and the left and right edges use the second If there are three values the top is set to the first value the sides are set to the second value and the bottom is set to the third value If there are four values they apply to the top right bottom and left edges in that order The following attributes can be specified to set each side explicitly trim top width trim bottom width trim right width trim left width Overprint Overprint mode can be enabled for the entire page by specifying the ibex ibex overprint stroking ibex overprint nonstroking and _ ibex overprint mode attribute
233. pecified for this element Parent element s This element can be contained in the following elements 268 index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title float footnote body static content table caption block block container Elements and Attributes Ibex PDF Creator Developers Guide inline folio suffix folio prefix inline container bidi override table cell list item label list item body marker Attributes The following attributes can be used on this element float clear id index class index key For an example showing the use of the element see Figure 25 19 Figure 25 19 8 519 lt block gt The float element lt float float start gt lt block container inline progression dimension 3cm padding 5mm gt lt block padding 2mm space before conditionality retain border 1pt solid white width 2cm gt lt block padding left 2mm gt lt external graphic src url ibexorange jpg content width 50 gt lt block gt lt block gt lt block container gt lt float gt lt block padding top 2mm padding bottom 2mm space before 9pt font 10pt minion regular gt This text should appear to the right of the image until we pass the bottom of the image and then appear below the image as well lt block gt lt block font 10pt minion regular gt We have lots of text here just
234. placed in this region The region has a default name of xsl region start which is usually changed to something simpler such as left using the region name attribute Within the region all of the content can be aligned to the top bottom or middle of the region using the display align attribute The content of the region can be rotated using the reference orientation attribute Unlike the region body element the region start does not have margin properties The size of the region is defined using the extent attribute Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements simple page master Attributes The following attributes can be used on this element background attachment background color background image background repeat background position horizontal background position vertical border border before color border before style border before width border after color border after style border after width border start color border start style border start width border end color border end style border end width border top border top color border top style 172 Elements and Attributes Ibex PDF Creator border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left clip
235. ple of a simple list is shown in Figure 4 34 Figure 4 34 Example of list block this is item one this is item two 24 Introduction to XSL FO Ibex PDF Creator Developers Guide This list was created with the FO shown in Figure 4 35 Figure 4 35 lt list block FO for the list block margin left 3cm margin right 3cm padding 3pt border 1lpt solid blue provisional distance between starts 0 5cm provisional label separation 0 1lcm gt lt list item gt lt list item label end indent label end gt lt block gt amp x2022 lt block gt lt list item label gt lt list item body start indent body start gt lt block gt this is item one lt block gt lt list item body gt lt list item gt lt list item gt lt list item label end indent label end gt lt block gt amp x2022 lt block gt lt list item label gt lt list item body start indent body start gt lt block gt this is item two lt block gt lt list item body gt lt list item gt lt list block gt A list sets the two columns to widths specified using the attributes of the list block elements The provisional distance between starts attribute specifies the distance between the start of the label column and the start of the body column The provisional label separation attribute sets how much of the label column should be left empty to provide a blank space between the columns If we expand the above example an
236. ple using System IO destinations using ibex4 using ibex4 logging public class Create pubike istorice swoalcl Miewin ernaar j 4 MemoryStream stream new MemoryStream Logger getLogger addHandler addHandler addHandler new ConsoleHandler new StreamHandler stream new FileHandler xslfo log Error Handling amp Logging 41 42 Error Handling amp Logging Chapter 8 Page Layout This chapter describes how to configure the size of a page and position the regions in which content appears 8 1 Using one layout for all pages The first element in any FO file is the root element which contains the whole FO tree defining the document and declares the XML namespaces used Figure 8 1 shows a simple FO file Figure EAE clad xmlns http www w3 org 1999 XSL Format gt Simple FO file lt layout master set gt lt simple page master master name layout page width 8 5in page height 8in gt lt region body region name body margin 2 5cm gt lt simple page master gt lt layout master set gt lt page sequence master reference layout gt lt flow flow name body gt lt block gt Hello world lt block gt lt flow gt lt page sequence gt lt root gt The first FO element within the root element is the layout master set element This contains one or more simple page master elements which define the layout of a page including the width and height The simple page maste
237. ples at the end of this chapter on page 49 For the purposes of this example the regions have background colors defined to show them clearly More complex layouts showing five regions appear in the examples on page 49 Having defined a page layout which has a name defined by its master name attribute we then use the page sequence element to define the content of the document The page sequence element has a master name attribute which should match the master name defined for a simple page master or a page sequence master more of which later A page sequence for printing Hello World is shown in Figure 8 3 Figure 8 3 lt page sequence master reference front page gt page sequence for lt flow low name body gt hello world lt block gt Hello World lt block gt lt flow gt lt page sequence gt A key thing to note is that the content of the page sequence is contained in a flow element For content of the flow to appear on the PDF page the flow name attribute of the flow element must match the region name of a region on the page master specified by the master reference on the page sequence If the flow name does not match a region name none of the content of this flow will appear in the output document It is important to understand this feature It means that a page sequence can contain multiple flow and static content elements each containing a flow element with a different flow name Only flow elements whose flow name
238. positioned relative to the position of the content This places the padding and borders outside the content area of the block The contents of the block are not indented rather the padding and borders extend outside the block This is the default behavior of XSL FO formatters Introduction to XSL FO 23 Ibex PDF Creator Developers Guide If you prefer Cascading Style Sheets CSS compatible behavior where adding a border to a block indents its content you can specify the left margin and right margin attributes to force this to happen Even if the left margin and right margin values are zero CSS type indentation will still occur The XML for this is shown in Figure 4 32 and the resulting output is shown in Figure 4 33 Figure 4 32 lt flow flow name body gt Block with margins lt plock background color eeeeee gt specified lt block gt Hello World lt block gt lt block border lpt solid red padding 3pt margin left 0 margin right 0 gt Hello World lt block gt lt block gt lt flow gt Figure 4 33 Default indentation of yello World nested blocks 4e11o world 4 9 Creating lists A list is content divided into two columns Each item in the list is in two parts called the label and the body respectively A list is created with the list block element A list block contains one or more list item elements each of which contains exactly one list item label element and one list item body element An exam
239. properties to this document Each custom property requiresa unique name which must be different from the standard property names found on other Document Properties panels Cre j Ca Cee These custom properties are inserted into the PDF using the ibex custom element as shown in Figure 22 3 Figure 22 3 8 3 lt root xmlns http www w3 org 1999 XSL Format FO using the xmlns ibex http www xmlpdf com 2003 ibex Format gt ibex custom element lt ibex properties title Ibex User Manual gt lt ibex custom name favourite color value blue gt lt ibex properties gt Each property must have a name and value attribute Extensions 139 Ibex PDF Creator Developers Guide 22 4 Image processing 22 4 1 Image resolution Ibex adds the dpi attribute to the external graphic element to permit managing the dots per inch resolution of images See Image resolution on page 100 22 4 2 Anti aliasing Ibex adds the ibex anti alias attribute to the external graphic element to permit disabling anti aliasing in order to achieve clearer images See Image anti aliasing on page 100 22 4 3 Multi page TIFF image processing Ibex adds the ibex page attribute to the external graphic element to specify which page of a muti page TIFF image should be included in the PDF file See Multi page TIFF images on page 105 22 5 Bookmarks XSL FO 1 0 had no support for creating bookmarks in the PDF file XSL
240. r element is like a template for a page defining the page size and the areas on the page into which content will be placed As content is read from a flow Ibex decides which simple page master to use as the basis for creating the current page If there is only one simple page master then it is always used If there are several simple page masters then a selection process is used to see which one applies to the current page The simple page master element contains region elements such as region body which define an area on the page which can be filled with text or image content There can be any number of simple page master elements provided each has a unique master name attribute Figure 8 2 shows an example of a layout master set Figure 8 2 lt layout master set gt Example lt simple page master master name front page gt layout master set Page Layout 43 Ibex PDF Creator Developers Guide lt region body margin right 2 5cm margin left 4cm margin bottom 4cm margin top 4cm region name body background color eeeeee gt lt region after extent 3cm region name footer background color dddddd gt lt simple page master gt lt layout master set gt This shows a layout master set which contains a single simple page master with a master name of front page This simple page master defines a page which has two regions on which content can be printed A page defined with this layout appears in the exam
241. r region name footer even extent 1 5cm display align before gt lt simple page master gt lt simple page master master name chapter odd gt lt region body region name body margin 2 5cm 2 5cm 2 5cm 4 0cm gt lt region before region name header odd extent 1 5cm display align after gt lt region after region name footer odd extent 1 5cm display align before gt lt simple page master gt To make content from a single flow element span multiple pages with different page layouts we use a page sequence master element as shown in Figure 8 8 This element contains a repeatable page master alternatives element which in turn contains a set of conditional page master reference elements When formatting content from a page sequence which has flow name chapter Ibex looks at each of the conditional page master reference elements and chooses which one will be active for the current page This is done by evaluating conditions specified with the page position attribute As a page is created each conditional page master reference is considered in turn starting from the first one The first one found whose conditions are satisfied will determine the page master for the 46 Page Layout Figure 8 8 The Ppage sequence master element Ibex PDF Creator Developers Guide current page Since alternatives are considered in the order in which they appear in the FO the order in which the alternatives are listed is important
242. r scheme where there are three parts to a color red green and blue Ibex also supports the CMYK color scheme commonly used in the printing industry 13 1 Text color The color of text is specified using the color attribute Figure 13 1 shows a simple example of some FO to make text blue The output is shown in Figure 13 2 Figure 13 1 lt block color blue gt FO for blue text To be or not to be that is the question lt block gt Figure 13 2 Blue text TPE resulting text will be blue like this 13 2 Background color The background color of any element is defined using the background color attribute Figure 13 3 shows FO for a block with a gray background The output from this is shown in Figure 13 4 Figure 13 3 lt block background color gray gt FO for gray To be or not to be that is the question background lt block gt Figure 13 4 Gray background The resulting text will have a gray background like this 9 00 Colors 73 13 3 13 3 1 13 3 2 13 3 3 Ibex PDF Creator Developers Guide Available colors The value used for the color and background color attributes can be a predefined color such as red an RGB color defined using a hex value such as eeffdd or a CMYK color Predefined colors XSL FO uses the list of colors defined for HTML 4 0 which contains these values aqua ibex black ibex blue ibex fuchsia ibex gray ibex green ibe
243. r set gt side regions lt simple page master master name simple margin 2 5cm gt lt region body margin 2 5cm margin bottom 1cm region name body background color eeeeee gt lt region after extent lcm region name footer background color dddddd gt lt region start extent 2 5cm gt lt region end extent 2 5cm gt lt simple page master gt lt layout master set gt By default the side regions take precedence over the top and bottom regions so the top and bottom regions become narrower This gives us the page layout shown in Figure 4 17 to which we can start adding some content Introduction to XSL FO 17 Ibex PDF Creator Developers Guide Figure 4 17 With side regions to reduce the width of the footer Hello World 4 3 Attribute processing The FO above also illustrates one of the ways in which XSL FO handles attributes We can specify a shorthand attribute such as margin which has the effect of setting the specific values margin left margin right margin top and margin bottom and then override just the specific value we want by setting margin bottom 1cm The order in which the attributes are specified has no effect A more specific setting will always override a more general one So the two examples in Figure 4 18 and Figure 4 19 produce the same result Figure 4 18 lt layout master set gt Shorthand and lt simple page master master name simple gt specific attribute
244. r such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color transparent inherit background image Description Specifies a URL for an image to be displayed in the background of an element See page 95 for an example Default value none background position horizontal Description Specifies the initial horizontal position of a background image See page 95 for an example Default value 0 Elements and Attributes 293 25 11 10 25 1111 25 1112 Ibex PDF Creator Developers Guide background position vertical Description Specifies the initial vertical position of a background image See page 95 for an example Default value 0 background repeat Description Specifies if a background image should be repeated when it is smaller than the containing area See page 95 for an example Default value repeat Values repeat The image is repeated horizontally and vertically repeat x The image is repeated horizontally only repeat y The image is repeated vertically only no repeat The image is not repeated baseline shift Description Specifies the amount by which text in an inline should be shifted from the baseline This is used to create subscript and superscript text See page 62 for an example Default value baseline Values baseline Text is not shifted sub Text is lowered by an amount read from the font file 294 Elements and Attributes
245. raesent risus Nam volutpat enim eget neque Maecenas a dui ac felis nonummy sollicitudin Proin iaculis Vestibulum in eros sit amet libero mollis convallis nunc laoreet tellus ullamcorper malesuada Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae Cras nec mauris Proin cursus tincidunt leo Maecenas metus lacus imperdiet fermentum blandit at sollicitudin eu sem Duis elementum libero vitae lacus Curabitur justo Aliquam erat volutpat Maecenas nec nulla in massa consectetuer volutpat Aenean turpis nisl rutrum a posuere sit amet varius in enim Praesent risus Nam volutpat enim eget neque Maecenas a dui ac felis nonummy sollicitudin Proin iaculis Vestibulum in eros sit amet libero mollis convallis lt block gt Side floats with float left or float right are closely tied to the block which contains the float element If the float element does not fit on the page then the float and some or all of the containing block will be moved to the following page This ensures that the text in the block does not refer to for example an image in the float which is not on the same page as the text How the float width is calculated Ibex looks at the content of the float element to try and determine how wide the float should be If a block container element is found directly below the float element and this block container has a width attribute then that determines the width of the float If
246. rd1 domainl doc setNetworkCredentials http www ibex4 com user2 password2 domain2 Internally Ibex uses the System Net WebRequest and System Net NetworkCredential objects to pass credentials to the remote server If credentials have been passed to Ibex using the setNetworkCredentials method a new NetworkCredential object is created when creating the WebRequest object SO the actual forwarding of the credentials to the remote server is all done by the NET framework Calls to setNetworkCredentials should be made before the generate method is called 16 10 Multi page TIFF image processing Ibex has an extension attribute ibex page which is used to specify which page of a multi page TIFF image should be included in the PDF file FO to place the third page of a multi page TIFF image is shown in Figure 16 30 Figure 16 30 Ha lt block gt Specifying the page of lt external graphic sro url 7pages tif ibex page 3 gt a multi page TIFF lt lock gt image Images 105 106 Images 17 2 Chapter 17 Scalable Vector Graphics SVG images Ibex supports the inclusion of Scalable Vector Graphics SVG images in the PDF file SVG images retain their vector format inside the PDF file so will remain precise under high magnification unlike bitmap images which will be come pixellated SVG images are inserted into the document using either the lt fo external graphic gt or lt fo instream foreign object
247. rder l1pt solid blue padding 2pt gt lt block gt row 2 column 2 lt block gt lt table cell gt lt table row gt lt table body gt It is possible to dispense with the table row element and have the table body contain table cell elements directly In this case any cell can have the ends row attribute set to true which causes a new row to be started containing the next cell This approach is sometimes easier to use when generating the FO using XSLT Figure 15 12 shows what the above FO would look like if we changed it to use implicit rows The output from this appears in Figure 15 13 below Figure 15 12 _ lt table gt FO for a table with lt table body gt implicit rows lt table cell border 1pt solid blue padding 2pt gt lt block gt row 1 column 1 lt block gt lt table cell gt lt table cell border lpt solid blue padding 2pt ends row true gt lt block gt row 1 column 2 lt block gt lt table cell gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 2 column 1 lt block gt lt table cell gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 2 column 2 lt block gt lt table cell gt lt table body gt 84 Tables Ibex PDF Creator Developers Guide Figure 15 13 Table with impli rows 15 5 Table columns The table column element is used to set the column width and other characteristics of a table column A table column element has an assoc
248. rder before color border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style Ibex PDF Creator border left width border right color border right width padding before padding start padding top padding left relative position top left alignment baseline destination placement offset external destination index class internal destination keep with next line height target processing context target stylesheet Developers Guide border right border right style padding padding after padding end padding bottom padding right bottom right alignment adjust baseline shift dominant baseline id index key keep together keep with previous show destination target presentation context 25 7 Formatting objects for bookmarks The objects described in this section are used to create bookmarks which link to parts of the document and appear in a tree structure Elements and Attributes 263 25 7 1 Figure 25 18 A bookmark tree Ibex PDF Creator Developers Guide bookmark tree Description This is the top level element in a tree of bookmarks used to create the bookmark entries displayed on the right side in a PDF viewer Child element s This element can contain the following elements bookmark zero or more Parent element s This element can be contained in the followi
249. rder top style border bottom border bottom style border left border left style border right border right style Elements and Attributes 245 Ibex PDF Creator border right width border before color border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style relative position top left border before precedence border end precedence index class visibility Notes on attributes Developers Guide border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width bottom right border after precedence border start precedence id index key As described in section 6 7 8 of the XSL FO specification only the background properties from this set apply If the value of border collapse on the table is collapse or collapse with precedence the border properties also apply 246 Elements and Attributes 25 4 8 Ibex PDF Creator Developers Guide table row Description This element acts as a container for table cell elements Table row elements are not required A table body element can contain table cell elements directly using the starts row and ends row
250. re pt points cm centimetres in inches mm millimetres em current font size in points 364 Elements and Attributes 25 11 131 25 11132 Ibex PDF Creator Developers Guide span Description This attribute is used on block level block table list block elements whose immediate parent element is a flow The span indicates if the block element should span all the columns of a multi column region body The only options are none and all It is not possible to span some but not all columns Default value none Values none Span one column all Span all columns inherit src Description This specifies the source for a external graphic element The src attribute is called a uri specification and must follow the following rules A sequence of characters that is url followed by optional white space followed by an optional single quote or double quote character followed by a URI reference as defined in RFC2396 followed by an optional single quote or double quote character followed by optional white space followed by The two quote characters must be the same and must both be present or both be absent If the URI reference contains a single quote the two quote characters must be present and be double quotes This means the following are all valid values for the src attribute uri ibex jpg uri ibex jpg uri ibex jpg url http www xmlpdf com images downloadz2 gif Defau
251. rence area This means a block container with absolute position absolute which is placed in a region will by default fill that region The height of a block container can be specified with the height attribute and the width with the width attribute Figure 18 3 shows the FO for a block container with height and width of 10cm and an inner block container which is offset from the outer one including a negative offset on the left side The output from this FO appears in Figure 18 4 lt flow flow name body gt lt block gt lt block container height 1l0cm width 10cm margin left 3cm background color dddddd gt lt block gt outer block container lt block gt lt block container absolute position absolute top Lem right 2cm left 2cm bottom 4cm background color 77ccdd gt lt block gt inner block container lt block gt lt block container gt lt block container gt lt block gt lt flow gt Figure 18 4 block containers outer block container positioned and sized Absolute Positioning 125 Ibex PDF Creator Developers Guide The example in Figure 18 4 shows how using a negative left value will position the content to the left of the containing reference area This is the technique used in this manual to place the labels next to each example 126 Absolute Positioning Figure 19 1 The page master for a multi column page Chapter 19 Columns XSL FO allows us to define a pa
252. rent element The style is italic The style is italic This sets the font weight of this element and elements it contains The specification supports numeric values These are mapped as follows 900 800 700 600 500 400 300 200 100 bold bold bold normal normal normal normal normal normal Elements and Attributes 339 25 11 79 25 11 80 Figure 25 88 Ibex PDF Creator Developers Guide Default value normal Values 100 900 See the table above normal The weight is inherited from the parent element bold The text will be bold inherit format Description In conjuction with grouping separator and grouping size this attribute sets the format to be used when formatting page numbers contained within this page sequence Default value 1 Values 1 Use numeric formatting so page numbers will be 1 2 3 i Use roman formatting so page numbers will be i ii iii iv v height Description Sets the height of the content of an element excluding padding and borders This means an element with height 3cm and border 25cm will have a height including borders and padding of 3 5cm This example shows the effect of the height attribute on the content of the block container lt block container space before l1cm height 3cm border 5cm solid red gt lt block gt 3 5 lt block gt lt block container gt 340 Elements and Attributes Ibex PDF Creator Developers Guide This produces this
253. rent font Child element s This element can contain the following elements 208 text basic link zero or more bidi override zero or more block zero or more block container zero or more character zero or more external graphic zero or more float one or more cannot be used inside an out of line element footnote one or more cannot be used inside an out of line element index page citation last zero or more index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element inline zero or more inline container zero or more instream foreign object zero or more leader zero or more list block zero or more page number zero or more page number citation zero or more page number citation last zero or more retrieve marker one or more subject to constraints specified for this element scaling value citation zero or more table zero or more table and caption zero or more wrapper one or more subject to constraints specified for this element Elements and Attributes Ibex PDF Creator Parent element s Developers Guide This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title footnote block inline folio suffix folio pre
254. rent values use the inline progression dimension and block progression dimension components like this Elements and Attributes 315 Figure 25 49 25 11 40 Figure 25 50 Figure 25 51 Ibex PDF Creator Developers Guide border separation inline progression dimension 3pt border separation block progression dimension 10pt For a non rotated page block progression dimension is down the page and inline progression dimension is across Default value opt Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit border spacing Description This is a shorthand method of setting the border separation attribute To set both horizontal and vertical separation the same use border spacing 3pt To set horizontal and vertical separation to different values use two values separated by a space like this border spacing 3mm 13mm The first value sets the horizontal spacing the second sets the vertical spacing Default value opt Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit 316 Elements and Attributes Ibex PDF Creator Developers Guide 25 11 41 border start color Description Sets the start border color the left side of a non rotated page For example Figure 25 52 8 a5 border
255. ription this is 2pt black dotted The top and left borders are slightly darker then the required color and the bottom and right borders are slightly lighter this is 2pt blue inset See example this is 2pt blue outset See example See example Sets the end border width the right side of a non rotated page For example border end width 1pt Default value medium Values lt border width gt Can be any of the values thin A thin border The actual default width is Settings BorderWidthThin and so can be changed programatically medium A medium border The actual default width is Settings BorderWidthMedium and so can be changed programatically thick A thick border The actual default width is Settings BorderWidthThick and so can be changed programatically lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit 308 Elements and Attributes 25 11 31 Figure 25 40 Ibex PDF Creator Developers Guide border left Description Sets the color width and style of the left border of an element A shorthand way of setting border left color border left width and border left style Any of the values listed can be combined for example you can have border left 12pt solid red Default value Shorthand properties do not have default values See individual properties for their default values Values lt co
256. root gt 76 Colors Chapter 14 Lists Lists are created using the list block element A list block in XSL FO is an area of content divided into two columns A simple list block is shown in Figure 14 1 The list created by this FO is shown in Figure 14 2 Figure 14 1 o lt list block provisional distance between starts 5cm FO for a list provisional label separation 0 1cm gt lt list item gt lt list item label end indent label end gt lt block font 8pt arial gt amp x25CF lt block gt lt list item label gt lt list item body start indent body start gt lt block gt item one lt plock gt lt list item body gt lt list item gt lt list item gt lt list item label end indent label end gt lt block font 8pt arial gt amp x25CF lt block gt lt list item label gt lt list item body start indent body start gt lt block gt item two lt block gt lt list item body gt lt list item gt lt list block gt Figure 14 2 Alist item one e item two Features of lists include e the list block is a block level element which contains the whole list e the provisional distance between starts attribute on the list block defines the distance between the start of the label and the start of the body e the provisional label separation attribute on the list block defines the size of the gap between the end of the label and the start of the body This gap is created by
257. roubles 12 3 Using linefeeds to break text The linefeed treatment attribute is used to specify the treatment of linefeeds in text This defaults to ignore causing linefeeds to be ignored We can retain the linefeeds by setting the linefeed treatment attribute to preserve Figure 12 3 shows our example with this attribute added Figure 12 4 shows the output from this FO Space Handling 69 Ibex PDF Creator Developers Guide Figure 12 3 lt block linefeed treatment preserve gt To be or not to be that is the question Using Whether tis nobler in the mind to suffer linefeed treatment The slings and arrows of outrageous fortune Or to take arms against a sea of troubles lt block gt Figure 12 4 Output with linefeeds preserved To be or not to be that is the question Whether tis nobler in the mind to suffer The slings and arrows of outrageous fortune Or to take arms against a sea of troubles 12 4 Retaining spaces The white space treatment and white space collapse attributes are used to control the handling of spaces If we want to put some formatted code in our documen Figure 12 5 shows FO for this Figure 12 5 i lt block linefeed treatment preserve gt Code example private void swap_byte ref byte x ref byte y byte t x x Vi y t lt block gt Setting linefeed treatment preserve we get the output show in Figure 12 6 We have preserved the linefeeds but all formatting space
258. rs Figure 16 27 lt block space before 6pt gt FO to insert an image lt external graphic border 1pt solid black from an HTTP server src url http www xmlpdf com images download2 gif content width 200 content height 200 gt lt block gt The FODocument object supports the setNetworkCredentials method This method takes 4 parameters as shown in Figure 16 28 Figure 16 28 public void setNetworkCredentials The string prefix setNetworkCredential string username s method string password string domain 104 Images Ibex PDF Creator Developers Guide The parameters are prefix The start of a URL such as http www xmlpdf com Any image URL which starts with this prefix will use these credentials username the username passed to the remote server password the password passed to the remote server domain the domain name passed to the remote server Each call to setNetworkCredentials is passed a prefix which is compared with image URLs to see which set of credentials to use For example if your application accesses two HTTP servers using different credentials your code might look like the code in Figure 16 29 Obviously you would get the username and password information from somewhere in your application rather than hard coding them Figure 16 29 FODocument doc new FODocument Setting credentials for different servers doc setNetworkCredentials http www xmlpdf com userl passwo
259. rties for their default values Values lt border style gt Can be any of the values none No border solid A single solid line this is 1pt solid black double Two lines separated by a gap The gap is 1 3 of the width of the border this is 4pt black double dashed See example Elements and Attributes 319 25 11 45 Figure 25 59 Ibex PDF Creator dotted inset outset groove ridge transparent inherit border top Description Developers Guide F this is 2pt black dotted The top and left borders are slightly darker then the required color and the bottom and right borders are slightly lighter this is 2pt blue inset See example this is 2pt blue outset See example See example Sets the color width and style of the top border of an element A shorthand way of setting border top color border top width and border top style Any of the values listed can be combined for example you can have border top 12pt solid red Default value Shorthand properties do not have default values See individual properties for their default values Values lt color gt A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color lt border width gt Can be any of the values thin 320 Elements and Attributes A thin border The actual default width is Settings BorderWidthThin and so can be changed programatically 25 11 46
260. rusion displace keep with next last line end indent line height orphans span text align last visibility widows Developers Guide font stretch font style font weight margin top margin right space before start indent relative position top left break before text depth id index key keep together keep with previous linefeed treatment line height shift adjustment white space treatment text align text indent white space collapse wrap option For an example showing the use of the element see Figure 25 1 190 Elements and Attributes 20 22 Ibex PDF Creator Developers Guide block container Description This element is used to create an area a reference area in the specifications terms that has a different writing direction or rotation If you want to achieve other ends such as keeping two blocks together use a block as the container If you do use reference orientation to rotate the content to be vertical on the page then you need to specify inline progression dimension to limit the vertical height of the content The block container element can be used to position content in a location relative to the page or to another block container by setting the absolute position attribute See 123 for more information Child element s This element can contain the following elements block zero or more block container zero or more float one or more cannot be used inside an out of line element index
261. s lt region body margin 2 5cm margin bottom 1cm gt lt simple page master gt lt layout master set gt Figure 4 19 g 419 lt layout master set gt Shorthandand lt simple page master master name simple gt specific attributes lt region body margin bottom 1cm margin 2 5cm gt lt simple page master gt lt layout master set gt 4 4 Adding content to the footer While content is added to the body of the page using the flow element content is added to other regions using the static content element The static part of the static content name refers to the fact that the content defined in this element stays within the region specified on this page It does not flow from one page to the next If the content exceeds the size of the region it will not flow to the next page 18 Introduction to XSL FO Ibex PDF Creator Developers Guide The content of the static content is repeated on every page which has a region with a matching flow name such as footer and is typically different on every page as the page number changes To insert a simple footer with the words XSL FO Example we add a static content element as shown in Figure 4 20 Figure 4 20 lt xml version 1 0 encoding UTF 8 gt Adding a lt root xmlns http www w3 org 1999 XSL Format gt static content lt layout master set gt lt simple page master master name simple element margin 2 5cm gt lt region body margin 2 5cm margin bottom 1
262. s 1 0 Type Library IAS Core Components 1 0 IAS DataStore2 1 0 _ IAS Network Access Policy 1 0 IAS SDO 1 0 Type Library __ Ibex COM Wrapper Ibex COM Wrapper iextag 1 0 Type Library ImageReady 2 0 Type Library Import 1 0 Type Library Indeo video custom control type library Indexing Service Administration Type Library 1 0 _ InetMar 6 0 Type Library iv TnsRenlM 1 0 Tyne ihrary A The COM wrapper provides an interface called IbexComInterface which can be used to declare a variable like this 148 Dim ibex As ibexcom IbexCOMInterface Using Ibex with Visual Basic and ASP Ibex PDF Creator Developers Guide The implementation of the interface is called Wrapper and can be created like this Set ibex New ibexcom Wrapper Note that each instance of the wrapper can be used to create only one PDF document The code contained in the example ibextest vbp project is Private Sub Form_Load On Error GoTo errorhandler Dim ibex As ibexcom IbexCOMInterface create the wrapper object Set ibex New ibexcom Wrapper ibex SetLoggingLevelToInfo ibex LogToFile ibex log generate file to file ibex GenerateFileFile hello fo hello pdf Set ibex Nothing generate stream to stream Set ibex New ibexcom Wrapper Dim strmInput As New Stream strmInput Open must match encoding of fo file or will get invalid data at 1 1 message Sstrminput Charset uti e strmInput LoadFromFile hello
263. s another block with a different font set using the font attribute Figure 4 29 8 ey lt flow flow name body gt Nested blocks lt block gt Hello World lt block font size 16pt gt this is a nested block lt block gt lt block gt lt flow gt There is no limit to the nesting of block elements 4 8 Using borders and padding Many FO elements can have a border around the area they create on the page If the border around an element is the same on all four sides then it can be defined with a single use of the border attribute The space between a border and the content of the block in this case the text is controlled using the padding attribute Figure 4 30 shows FO for a block with border and padding Figure 4 30 i lt flow flow name body gt Block with borderand lt plock background color eeeeee gt padding lt block gt Hello World lt block gt lt block border 1pt solid red padding 3pt gt Hello World lt block gt lt block gt lt flow gt This example has two block elements nested inside an outer element with a background color set on the outer element to highlight the area created by the outer block The block created from this FO is shown in Figure 4 31 Figure 4 31 Default indentation of 4 316 world nested block 4 316 world Ibex positions the content of the block in this case the text relative to the edge of the region After positioning the content the padding and borders are
264. s as shown in Figure 23 4 lt simple page master page height 313mm page width 226mm master name page ibex overprint stroking true ibex overprint nonstroking true ibex overprint mode 1 gt PDF X 145 146 PDF X Chapter 24 Using Ibex with Visual Basic and ASP Ibex ships with binaries and source code for a COM wrapper which enables Ibex to be used from Visual Basic 6 0 and ASP applications This code can either be used as is or as the basis for developing your own wrapper This chapter describes how this COM wrapper works 24 1 The COM Wrapper Within the Ibex distribution is a subdirectory called ibexcom In this directory is the source for a NET project This source is used to build the file ibexcom dll which is the COM wrapper for Ibex 24 1 1 Building the Wrapper The COM wrapper can be built using the nmake command The makefile executes the commands show in Figure 24 1 to build and register ibexcom dll and ibexcom tlb Figure 24 1 copr ibexll dll tbexll dll Commands to build esc r ibexll dll target library out ibexcom dll unsafe assemblyinfo cs the wrapper wrapper cs comstream cs ibexinterface cs regasm ibexcom dll tlb gacutil i ibexcom dll gacuc iE R pex mE aN 24 1 2 VB6 Example This section shows how to use Ibex from VB6 Ibex ships with an example VB6 project in the file TestIbex vbp The steps below detail how this project was created Before you can use the Ibex COM wrapper you sho
265. s determined from the Settings PageWidth property Default value auto Values auto lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points precedence Description This is used on region before and region after elements to control whether the top and bottom regions take precedence over i e extend into the corners over the side regions Elements and Attributes 357 25 11 118 25 11 119 25 11 120 Ibex PDF Creator Developers Guide Default value false Values false true provisional distance between starts Description This applies to the list block element and sets the distance in each list item between the start of the label element and the start of the body element This is not the same as the width of the label element because the width of the label element is reduced by the provisional label separation value See list block for an example Default value 24pt provisional label separation Description This applies to the list block element and sets the distance between the end of the label element and the start of the body element See list block for an example and also provisional distance between starts Default value 6pt reference orientation Description This attribute is used to set the rotation of whole pages when used on simple page master regions when used on region element blo
266. s have gone Figure 12 6 Code with linefeeds private void swap bytel ref byte x ref byte y but no spacing byte t x x MP M eR The white space collapse attribute controls whether Ibex compresses adjacent white space characters into a single space By default any number of adjacent spaces are compressed into a single space The white space treatment attribute controls whether Ibex ignores spaces adjacent to linefeeds Setting white space treatment preserve makes Ibex retain white space which appears adjacent to linefeeds If we set white space treatment to preserve and white space collapse to false we will retain the white spaces around the linefeeds The FO for this is shown in Figure 12 7 and the formatted output is shown in Figure 12 8 Figure 12 7 Eee FO to retain spaces linefeed treatment preserve and linefeeds white space treatment preserve white space collapse false gt private void swap_byte ref byte x ref byte y 70 Space Handling Ibex PDF Creator Developers Guide byte t x a iG yo lt block gt Figure 12 8 Output with linefeeds __ f private void swap_byte ref byte x ref byte y but no spacing byts sp B 9 y iby 12 5 Non breaking spaces Unicode defines the code point U o00Ao called NO BREAK SPACE This can be used to insert a space between words without allowing a line break to occur between the words Ibex treats two words separated by a U 00A0
267. s less than the width of the cell This can be changed using the background repeat attribute If this is set to no repeat the output changes to that shown in Figure 15 9 Figure 15 9 Using r this cell has padding set to lpt so the n th ll h back d background repeat text is close to the edges of the cell oe Y PERIE ee no repeat Tables 83 Ibex PDF Creator Developers Guide The background image can be positioned in the cell using the background position horizontal and background position vertical attributes The cell in Figure 15 10 example has background position horizontal set to 50 Figure 15 10 Centering the z 3 ng this cell has padding set to lpt so the A cell hassas F ground background Image text is close to the edges of the cell ia A image Y 15 4 Implicit and explicit rows Usually FO files use the table row element to define which cells are in which rows as shown in Figure 15 11 Figure 15 11 g lt table gt Tables with cells lt table body gt contained in rows lt table row gt lt table cell border 1pt solid blue padding 2pt gt lt block gt row 1 column 1 lt block gt lt table cell gt lt table cell border 1pt solid blue padding 2pt gt lt block gt row 1 column 2 lt block gt lt table cell gt lt table row gt lt table row gt lt table cell border 1pt solid blue padding 2pt gt lt block gt row 2 column 1 lt block gt lt table cell gt lt table cell bo
268. s of the inline progression dimension attribute Default value auto 370 Elements and Attributes 25 11 145 25 11 146 Ibex PDF Creator Developers Guide Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points wrap option Description This option controls word wrapping within an element Default behavior for text within a block is for words which do not fit on one line to wrap to the next line and the height of the block to increase If wrap option no wrap then words which do not fit on the first line are discarded if overflow hidden See also overflow Default value wrap Values inherit wrap words wrap to the next line no wrap words do not wrap to the next line z index Description This attribute controls the positioning of one element over another By default a more deeply nested element will appear over its container element but by changing the z order you can change which elemnets appear over which other elements Default value auto Elements and Attributes 371 372 Elements and Attributes 26 1 Chapter 26 Compliance with the XSL FO standard This chapter describes which extent to which Recommendation 1 1 dated 5 December 2006 Ibex supports the XSL W3C Objects are listed grouped together in the same way in which they appear in the specification Declarations and pagination and
269. s text of that element This sets the padding on the end edge of an element which for an non rotated area is the right edge padding end l1pt Default value opt Values inherit lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points 354 Elements and Attributes 25 11 111 Figure 25 107 eat ate Figure 25 108 Ibex PDF Creator Developers Guide padding left Description Padding is space which appears between the border of an element and the content such as text of that element This sets the padding on the left edge of an element padding left l1pt Default value opt Values inherit lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points padding right Description Padding is space which appears between the border of an element and the content such as text of that element This sets the padding on the right edge of an element padding right l1pt Default value opt Values inherit lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points Elements and Attributes 355 25 11 113 Figure 25 109 25 11 114 Figure 25 110 Ibex PDF Creator Developers Guide padding start Description Padding is space
270. solid blue padding 5pt background color dddddd gt lt block background color dddddd gt this cell has padding set to 5pt so the text is not so close to the edges of the cell lt block gt lt table cell gt lt table row gt lt table body gt Figure 15 6 Cell with background z 8 this cell has padding set to color on the block Mise SO the bezt 1S Closs ico element this cell has padding set to 5pt so the text is not so close to the edges of the cell the edges of the cell 15 3 Cell background images An image can be used as the background to a cell by specifying the background image element as shown in Figure 15 7 This produces the output shown in Figure 15 8 Figure 15 7 E FO for using an image lt table body gt as a cell background lt table row gt lt table cell border lpt solid blue padding 1pt gt lt block gt this cell has padding set to lpt so the text is close to the edges of the cell lt block gt lt table cell gt lt table cell border lpt solid blue padding 5pt background image url ibex jpg gt lt block gt this cell has a background image lt block gt lt table cell gt lt table row gt lt table body gt Figure 15 8 Cell with image A z 8 this cell has padding set to lpt so the this ce NA a background background Tert le elope WO The eckes OF the call I image As the above example shows by default the image will be repeated if it i
271. starts the gradient at the left hand edge of the element being filled and specifying x1 0 2 starts the gradient at 20 of the width of that element As the gradient is positioned relative to the element being filled two element using the same gradient will appear the same regardless of the position of the element 120 Scalable Vector Graphics SVG images Ibex PDF Creator Developers Guide This SVG image shows rectangles using the same gradient in conjunction with gradientUnits userSpaceOnUse producing the image below Scalable Vector Graphics SVG images 121 122 Scalable Vector Graphics SVG images 18 1 Figure 18 1 Badly positioned block containers Chapter 18 Absolute Positioning Content can be positioned anywhere on the page by placing the content in a block container element and setting the absolute position attribute If the absolute position attribute is set to fixed the content will then be positioned on the page relative to the page area which contains the block container element If the absolute position attribute is set to absolute the content will be positioned on the page relative to the reference area which contains the block container element The reference area is not the containing block it is the containing region table cell block container inline container or table caption In XSL FO 1 0 the specification was ambiguous and the block container was positioned relative to the c
272. stas Duis rutrum Nulla in enim Suspendisse vel massa in mauris sagittis pharetra Etiam hendrerit euismod 9 9 Figure 9 11 Setting the left margin velit Ut laoreet lectus nec nisl Developers Guide Nunc mollis turpis The text align last attribute controls the alignment of the last line of a paragraph Values include are shown in the table below Value Effect relative if text align is justify align the last line against the start edge normally the left edge otherwise use the setting if the text align attribute left text is aligned against the left edge of the block right text is aligned against the right edge of the block start text is aligned against the start edge which for a block that is not rotated with the default left to right writing direction is the left edge end text is aligned against the end edge which for a block that is not rotated with the default left to right writing direction is the right edge inside assuming the document is to be bound as a book text is aligned against the edge which is nearest the binding For an odd numbered page this will be the left edge for an even numbered page it will be the right edge outside assuming the document is to be bound as a book text is aligned against the edge which is furtherest from the binding For an odd numbered page this will be the right edge for an even numbered page it will be the left edge justify justify the
273. sually changed to something simpler using the region name attribute A page can be defined which has multiple columns by using the column count and column gap attributes on this region Within the region all of the content can be aligned to the top bottom or middle of the region using the display align attribute Ibex supports multiple body regions There can be any number of body regions provided each has a unique region name Content from different flows is mapped to different regions using the flow map element The content of the region can be rotated using the reference orientation attribute Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements simple page master Attributes The following attributes can be used on this element background attachment background color background image background repeat background position horizontal background position vertical border border before color border before style border before width border after color border after style border after width border start color border start style border start width border end color border end style border end width border top 166 Elements and Attributes Ibex PDF Creator border top color border top width border bottom color border bottom width border left color border left width border right color border right width p
274. t Parent element s This element can be contained in the following elements 188 wrapper basic link float footnote body static content table caption block Elements and Attributes Ibex PDF Creator block container inline inline container bidi override table cell list item label list item body marker Attributes Developers Guide The following attributes can be used on this element background attachment background image background position horizontal border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left font family background color background repeat background position vertical border before color border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right font selection strategy Elements and Attributes 189 Ibex PDF Creator font size font size adjust font variant margin margin bottom margin left space after end indent bottom right break after color text altitude index class int
275. t lt HEAD gt lt title gt pdfgen lt title gt lt meta name GENERATOR Content Microsoft Visual Studio NET 7 1 gt lt meta name CODE_LANGUAGE Content C gt lt meta name vs_defaultClientScript content JavaScript gt lt meta name vs_targetSchema content http schemas microsoft com intellisense ie5 gt lt HEAD gt lt body MS_POSITIONING GridLayout gt lt form id Forml method post runat server gt LOom gt lt body gt lt HIML gt Using Ibex with ASP NET 33 Ibex P 6 2 The DF Creator ASP code behind page Developers Guide The pdfasp aspx cs file contains the code shown in Figure 6 2 plus some error handling that is Figure 6 2 The code behind page using using using using using using using using using using using using using using using using using names pub pe not shown for clarity System System Collections System ComponentModel System Data System I0 System Text System Drawing System Web System Web SessionState System Web UI System Web UI WebControls System Web UI HtmlControls System Xml System Xml Xsl System Security Policy ibex4 ibex4 logging pace WebApplicationl lic class pdfasp System Web UI Page vate void Page_Load object sender Logger getLogger setLevel Level FINEST clearHandlers try Stream stream new FileStream Server MapPath logs log txt FileAccess Write Lo
276. t lt bookmark internal destination section 1 gt lt bookmark title gt Chapter 1 lt bookmark title gt lt bookmark internal destination section 1 1 gt lt bookmark title gt Section 1 lt bookmark title gt lt bookmark gt lt bookmark internal destination section 1 2 gt lt bookmark title gt Section 2 lt bookmark title gt lt bookmark gt lt bookmark gt lt bookmark internal destination section 2 gt lt bookmark title gt Chapter 2 lt bookmark title gt lt bookmark internal destination section 2 1 gt lt bookmark title gt Section 1 lt bookmark title gt lt bookmark gt lt bookmark gt lt bookmark tree gt We can see the following from the structure shown in Figure 20 1 The bookmarks are contained in a bookmark tree element e A bookmark element has an internal destination attribute identifying where in the document it links to The value for this attribute should be used as the id attribute on the destination element A bookmark element can contain other bookmark elements e The text which appears in the bookmark is contained within a bookmark title element Ibex supports using Unicode text in bookmarks The example above creates bookmarks like the ones in the Ibex manual Bookmarks 129 Ibex PDF Creator Developers Guide The bookmarks which have child bookmark elements appear in the PDF file in a closed state so the user can click the next to them to display the child elements If you
277. t table gt Default value This attribute has no default value you must provide a value Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points content height Description This is used on a graphic element such as a external graphic to set the height of the image The size of an image and the size of the area containing it are two seperate things The height and width attributes set the size of the area containing the image the content height and content width attributes set the size of the image itself Percentage values refer to percentages of the actual size of the image as determined from the image file 330 Elements and Attributes 25 11 64 25 11 65 Ibex PDF Creator Developers Guide Default value auto Values lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit scale to fit content width Description This is used on a graphic element such as a external graphic to set the width of the image The size of an image and the size of the area containing it are two seperate things The height and width attributes set the size of the area containing the image the content height and content width attributes set the size of the image itself Percentage values refer to percentages of the actual size of the imag
278. t be used inside an out of line element footnote one or more cannot be used inside an out of line element index page citation last zero or more index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element inline zero or more inline container zero or more instream foreign object zero or more leader zero or more list block zero or more page number zero or more page number citation zero or more page number citation last zero or more retrieve marker one or more subject to constraints specified for this element scaling value citation zero or more table zero or more table and caption zero or more wrapper one or more subject to constraints specified for this element Elements and Attributes 195 Ibex PDF Creator Developers Guide Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title block inline folio suffix folio prefix bidi override marker Attributes The following attributes can be used on this element 196 font family font size font size adjust font variant margin margin bottom margin left bottom right color id index key line height unicode bidi Elements and Attributes font selection strategy f
279. t element s This element can be contained in the following elements flow source list Attributes The following attributes can be used on this element flow map reference For an example showing the use of the element see Elements and Attributes 183 25 1 20 Ibex PDF Creator Developers Guide flow target list Description The flow target list contains a list of region name specifier elements which specify the names of regions which will be assigned by the containing flow map Child element s This element can contain the following elements region name specifier one or more Parent element s This element can be contained in the following elements flow assignment For an example showing the use of the element see 184 Elements and Attributes 25 1 26 Ibex PDF Creator Developers Guide region name specifier Description The region name specifier has one attribute which specifies the name of a region This is used in the flow map element to add the named region to a list of regions mapped to flows Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements flow target list Attributes The following attributes can be used on this element region name reference For an example showing the use of the element see Elements and Attributes 185 Ibex PDF Creator Developers Guide 25 2 Block
280. t fo region body margin 2 5cm region name body background color eeeeee gt lt fo simple page master gt lt fo layout master set gt lt fo page sequence master reference simple gt lt fo flow flow name body gt lt fo block gt Hello World lt block gt lt fo flow gt lt fo page sequence gt lt fo root gt 4 1 2 The root element The root element shown in Figure 4 3 contains the whole content of the file and establishes the XSL FO namespace as the default namespace This element is the same for all FO files Figure 4 3 lt root xmlns http www w3 org 1999 XSL Format gt The root element Additional namespaces can be added to the xml element as shown in Figure 4 4 Figure 4 4 Ta lt root xmins http www w3 org 1999 XSL Format The root element with xmlns ibex http www xmlpdf com 2003 ibex Format additional xmlns svg xmlns http www w3 org 2000 svg namespaces 4 1 3 The layout master set element The layout master set element show in Figure 4 5 defines the shape and layout of pages in the document Within the layout master set we have a simple page master element which in turn contains the region body element The simple page master defines the layout of one type of page and is uniquely identified by its master name attribute The region body element defines an area of the page where content will be placed A page can have more than one region so we give the region a unique name body
281. t of this element Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements Attributes The following attributes can be used on this element change bar class change bar color change bar offset change bar placement change bar style z index Elements and Attributes 283 Ibex PDF Creator Developers Guide 25 10 3 wrapper Description This element is used to specify inherited attributes for the elements it contains Child element s This element can contain the following elements 284 text basic link zero or more bidi override zero or more block zero or more block container zero or more character zero or more external graphic zero or more float one or more cannot be used inside an out of line element footnote one or more cannot be used inside an out of line element index page citation last zero or more index range begin one or more subject to constraints specified for this element index range end one or more subject to constraints specified for this element inline zero or more inline container zero or more instream foreign object zero or more leader zero or more list block zero or more page number zero or more page number citation zero or more page number citation last zero or more retrieve marker one or more subject to constraints specified
282. t path gt elements The lt marker gt element contains a separate drawing which can be reused This example shows an arrowhead which is drawn at the each end of a line 116 Scalable Vector Graphics SVG images Ibex PDF Creator Developers Guide lt xml version 1 0 standalone no gt lt svg width 4in height 2in viewBox 0 0 4000 2000 version 1 1 xmlns http www w3 org 2000 svg gt lt defs gt lt marker id RedTriangle viewBox 0 0 10 10 refxX 0 refy 5 markerUnits strokeWidth markerWidth 4 markerHeight 3 orient auto fill red gt lt path d M 0 0 L 10 5 L 0 10 z gt lt marker gt lt defs gt lt rect x 10 y 10 width 3980 height 1980 fill none stroke blue stroke width 10 gt lt g transform translate 400 1700 scale 8 gt lt line x1 0 x2 1000 y1 0 y2 0 stroke red stroke width 100 marker end url RedTriangle marker start url RedTriangle gt lt g gt lt g transform translate 400 700 scale 8 gt lt line x1l 0 x2 1000 yl 300 y2 0 stroke red stroke width 30 marker end url RedTriangle marker start url RedTriangle gt lt g gt lt svg gt In this example the arrowhead appears once in the SVG and is rendered four times Each time it is rendered its rotaton and size are changed to match the rotation and size of the line wee j 17 7 Linear gradients Linear gradients are supported This example pro
283. tent elements all containing footers Only the footer whose flow name matches the region name for the currently active simple page master will be rendered 4 5 Adding the page number to the footer To insert the current page number into the document use the page number element inside the static content element as shown in Figure 4 22 Figure 4 22 f lt xml version 1 0 encoding UTF 8 gt Adding a page lt root xmlns http www w3 org 1999 XSL Format gt number lt layout master set gt lt simple page master master name simple margin 2 5cm gt lt region body margin 2 5cm margin bottom 1cm region name body background color eeeeee gt lt region after extent lcm region name footer background color dddddd gt lt region start extent 2 5cm gt lt region end extent 2 5cm gt lt simple page master gt lt layout master set gt lt page sequence master reference simple gt lt static content flow name footer gt lt block text align center gt XSL FO Example page lt page number gt lt block gt lt static content gt lt flow flow name body gt lt block gt Hello World lt block gt lt flow gt lt page sequence gt lt root gt This FO produces the page shown in Figure 4 23 20 Introduction to XSL FO Ibex PDF Creator Developers Guide Figure 4 23 Page with page number Hello World XSL FO Example page 1 4 6 Adding the total page count to the footer Add
284. ter reducing the image dpi to 600 will not effect the appearance of the image Setting the dpi to a value higher than the value read from the image file has no effect If for example if we wanted to store an image in the PDF file at 1200 dpi we would use the FO shown in Figure 16 12 Figure 16 12 g lt block space before 6pt gt FO to set image dpi lt external graphic border 1pt solid black src url http www xmlpdf com images download2 gif content width 200 content height 200 dpi 1200 gt lt block gt The dpi attribute is an Ibex extension It is not part of the XSL FO standard 16 6 Image anti aliasing Images are anti aliased by default This can be disabled using the ibex anti alias attribute as shown in figure Figure 16 13 Figure 16 13 3 lt block space before 6pt gt FO to disable lt external graphic anti aliasing src url http www xmlpdf com images download2 gif ibex anti alias false dpi 1200 gt lt block gt Figure 16 14 shows two images the left right one has anti aliasing disabled so the edges of the image appear more clearly 100 Images Ibex PDF Creator Developers Guide Figure 16 14 Images with and without anti aliasing The ibex anti alias attribute is an Ibex extension It is not part of the XSL FO standard 16 7 Loading an image from memory Ibex has the facility to load an image which is stored in memory This permits an application to dynamically generate
285. ter reference toc page gt lt flow flow name body gt lt block gt content that appears in the table of contents lt block gt lt flow gt lt page sequence gt Page Layout 45 8 2 2 Figure 8 7 Page masters for three different layouts Ibex PDF Creator Developers Guide When using this approach content from one flow always appears on pages with the same layout Flowing content across different page layouts is described in the next section Using page master alternatives Often it is desirable to have content flow continuously across pages with different layouts This is done in the Ibex manual where the pages are laid out like this first page of chapter has no page header page number is on the right of the footer even numbered page has a page header page number is on the left of the footer odd numbered page has a page header page number is on the right of the footer The three page masters are shown in Figure 8 7 lt simple page master master name chapter odd no header gt lt region body region name body margin 2 5cem 2 5cm 2 5cm 4 0cm gt lt region after region name footer odd extent 1 5cm display align before gt lt simple page master gt lt simple page master master name chapter even gt lt region body region name body margin 2 5cm 2 5cm 2 5cm 4 0cm column count 1 gt lt region before region name header even extent 1 5cm display align after gt lt region afte
286. ters must be present and be double quotes float Description Specifies how the block which is floated should be positioned Specify float start or float before to move the block to the start of the page Specify float left to position content to the left side of the page and have other content flow around the right side of the positioned content Default value none 334 Elements and Attributes rao 2011 72 25 11 73 Ibex PDF Creator Developers Guide Values inherit before start end left right flow map name Description Specifies a unique name for a flow map page sequence elements which will be laid out with that flow map will have the same value for their flow map reference attribute Default value none a value is required flow map reference Description This is used on a page sequence to specify the name of a flow map which will control the layout of content in flows to regions It is also used on a flow name specifier to specify the name of a flow which will be mapped using the containing flow map Default value none a value is required flow name Description This attribute is used on flow and static content elements to define which region the content from the flow and static content is placed For content to be placed on the page the flow name attribute must correspond to the region name attribute of a region of the current page layout If the flow name is not the Elements
287. the height of a line depends on the height of the characters or images on that line The information which follows assumes that this default value is used The other values for line stacking strategy namely font height and line height will produce different results since the height of the line using these strategies does not change when the content of the line changes The leading value is calculated from the line height and font size specified for the block element which contains the text It is constant for the whole block and is not affected by other values specified on contained within the block The height the line is calculated using largest characters found on the line i e the sum of the max ascender and max descender values Aligning images An inline element such as external graphic is treated similarly to a text element The height of the image is used as the ascender value The descender value is zero This means that by default an image will be positioned on the baseline as shown in Figure 9 39 PE 1 2 leading 4 0 D t line height descender baseline 1 2 leading Text Formatting 63 Ibex PDF Creator Developers Guide A large image will contribute a large ascender value to the baseline placement calculation but will still sit on that baseline as shown in Figure 9 40 Figure 9 40 Large image on baseline 40pt 9 16 1 The before edge baseline baseline By default an element has
288. the page s content area so when we add margins to the simple page master we reduce the size of the regions correspondingly Introduction to XSL FO 15 Ibex PDF Creator Developers Guide Our page now appears as shown in Figure 4 12 Figure 4 12 After adding margins to the simple page master Hello World Now that we have some space on the sides of the body region we can remove the side margins from the body by changing the definition from that shown in Figure 4 13 to the one shown in Figure 4 14 resulting in the page layout shown in Figure 4 15 Figure 4 13 f lt region body margin 2 5cm region name body Body with side background color eeeeee gt margins Figure 4 14 _ lt region body margin top 2 5cm margin bottom 2 5cm Body without side region name body background color eeeeee gt margins 16 Introduction to XSL FO Ibex PDF Creator Figure 4 15 After removing the left and right margins from the region body Developers Guide Hello World The last thing we need to do to get a working page layout is to make the footer region narrower by adding side regions The left side region is created with a region start element and the right side with a region end element as in Figure 4 16 We can also specify the bottom margin attribute of the body region so that it ends just where the footer starts by setting margin bottom 1cm on the region body element Figure 4 16 lt layout maste
289. the symbol element with id MySymbol and display the content of this element which should look like this lt use gt The lt use gt element is supported see above for an example Note that as this element uses the xlink href attribute it is necessary to declare the xmIns xlink http www w3 org 1999 xlink namespace Scalable Vector Graphics SVG images 109 17 4 8 17 4 9 17 4 10 Ibex PDF Creator Developers Guide lt image gt The lt image gt element is supported This element embeds an image inside the SVG image For example this image will display a rectangle and on top of that display the image held in the file use_symbol svg lt xml version 1 0 gt lt svg width 4cm height 2cm viewBox 0 0 200 100 xmlns xlink http www w3 org 1999 xlink xmlns http www w3 org 2000 svg version 1 1 preserveAspectRatio none gt lt rect width 300 height 150 stroke red stroke width 1 fill silver gt lt image x 20 y 20 xlink href use_symbol svg width 100 height 100 gt lt svg gt lt switch gt The lt switch gt element is ignored lt path gt The lt path gt element is supported Internally PDF does not support quadratic B zier curves so they are converted to cubic B zier curves The following SVG draws a simple curve with marked end points lt xml version 1 0 standalone no gt lt svg width 6cm height 5cm viewBox 0 0 1200 600 xmlns http www w3 org 2000
290. this ibex20 logfile ibex log hello fo hello pdf 5 1 3 Listing available fonts You can also list the fonts which are available based on what fonts are installed on your system by using the fonts option like this ibex20 fonts The list of fonts is produced as a FO file to the standard output This can be redirected to a file and then used as input to Ibex to create a PDF file containing a table which looks like this file usage example c windows fonts MOB_____ TTF 10pt minion 10pt minion minion c windows fonts MOB_____ TTF bold 10pt minion bold 10pt minion c windows fonts MOI_____ TTF litalic 10pt minion italic 10pt minion c windows fonts MOBI____ TTF bold italic 10pt minion bold italic 10pt minion 5 2 The list of fonts can be limited to fonts whose name contains a specified string by passing the string on the command line For instance if we wanted to see what versions of arial are installed we can use the command ibex20 fonts arial The Ibex API A PDF document is generated using the FODocument object which is in the ibex4 namespace First you create a new FODocument object and then calling the generate method on that object The generate method has various versions which take different parameters depending on whether the input is from files or streams and whether XSLT translation should occur The FODocument object is not thread safe A new FODcoument should be created for each PDF file to be created Ibex does
291. this is 4pt black double dashed See example rthis is 2pt black dashed i Pe d dotted See example this is 2pt black dotted inset The top and left borders are slightly darker then the required color and the bottom and right borders are slightly lighter this is 2pt blue inset outset See example this is 2pt blue outset groove See example ridge See example 314 Elements and Attributes 25 11 38 Figure 25 47 25 11 39 Figure 25 48 Ibex PDF Creator Developers Guide inherit border right width Description Sets the right border width For example border right width 1pt Default value medium Values lt border width gt Can be any of the values thin A thin border The actual default width is Settings BorderWidthThin and so can be changed programatically medium A medium border The actual default width is Settings BorderWidthMedium and so can be changed programatically thick A thick border The actual default width is Settings BorderWidthThick and so can be changed programatically lt length gt A length such as 1ocm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit border separation Description Sets the separation between cell borders in a table with border collapse separate To set both horizontal and vertical separation the same use border separation 3pt To set horizontal and vertical separation to diffe
292. tically medium A medium border The actual default width is Settings BorderWidthMedium and so can be changed programatically thick A thick border The actual default width is Settings BorderWidthThick and so can be changed programatically lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points inherit 318 Elements and Attributes Ibex PDF Creator Developers Guide 25 11 44 border style Description Sets the border style for all four sides of an element to the same style or to a number of different styles To set all borders to the same style use a single value like this Figure 25 55 8 5 55 border style solid If there are two values the top and bottom borders are set to the first value and the side borders are set to the second like this Figure 25 56 border style solid none If there are three values the top border is set to the first value the side borders are set to the second and the bottom is set to the third like this Figure 25 57 border style solid none double If there are four values the top border is set to the first value the right border is set to the second the bottom is set to the third and the left is set to the forth so clockwise from the top like this Figure 25 58 f border style solid none double dotted Default value Shorthand properties do not have default values See individual prope
293. tings BorderWidthThick and so can be changed programatically lt length gt A length such as 10cm Valid units are pt points cm centimetres in inches mm millimetres em current font size in points lt border style gt Can be any of the values none No border solid A single solid line this is 1pt solid black double Two lines separated by a gap The gap is 1 3 of the width of the border this is 4pt black double dashed See example i this is 2pt black dashed i kannn ee a dotted See example 302 Elements and Attributes 25 11 23 Figure 25 30 25 11 24 Figure 25 31 Ibex PDF Creator Developers Guide ithis is 2pt black dotted inset The top and left borders are slightly darker then the required color and the bottom and right borders are slightly lighter this is 2pt blue inset outset See example this is 2pt blue outset groove See example ridge See example inherit border bottom color Description Sets the bottom border color For example border bottom color red Default value the value of the color property Values lt color gt A color such as red blue etc or an RGB color such as 445566 or a CMYK color defined using the rgb icc color inherit border bottom style Description Sets the bottom border style For example border bottom style solid Elements and Attributes 303 Ibex PDF Creator Developers Guide Default value none Values
294. tion registered in the U S Patent and Trademark Office and may be registered in certain other jurisdictions Unicode is a registered trademark of Unicode Inc All other trademarks are the property of their respective owners This publication and the information herein are furnished AS IS are subject to change without notice and should not be construed as a commitment by Visual Programming Limited Visual Programming Limited assumes no responsibility or liability for any errors or inaccuracies makes no warranty of any kind express implied or statutory with respect to this publication and expressly disclaims any and all warranties of merchantability fitness for particular purposes and noninfringement of third party rights Chapter 1 Introduction This manual describes the functionality and use of the Ibex PDF Creator Ibex is a PDF creation component which can be used from the command line or integrated into a larger application It ships as a NET Assembly so it can be used both in stand alone applications and in server based applications using ASP and ASP NET This chapter provides an overview of how Ibex works and the process involved in creating PDF files using Ibex 1 1 The PDF creation process Ibex creates PDF files which contain data from your application You provide Ibex with your data in XML format and Ibex creates a PDF file containing that data The format of the PDF file is specified using an XML template which defines t
295. to show that it will be formatted in the correct way and eventually there will be enough text to go past the image and appear below it on the page Then we will have some XML which shows how to acheive this effect We have lots of text here just to show that it will be formatted in the correct way and eventually there will be enough text to go past the image and appear below it on the page Then we will have some XML which shows how to acheive this effect We have lots of text here just to show that it will be formatted in the correct way and eventually there will be enough text to go past the image and appear below it on the page Then we will have some XML which shows how to acheive this effect lt block gt lt block gt Elements and Attributes 269 20 6 2 Ibex PDF Creator Developers Guide footnote Description This element is used to insert a footnote which will appear at the bottom of the region The footnote contains an inline which is the anchor and is position in the containing block at the point the footnote occurs The contents of the footnote body are move out of line to the end of the region Child element s This element can contain the following elements footnote body exactly one inline exactly one Parent element s This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index pag
296. ts It can also be used to include SVG images held in external files The inline foreign object is used for loading images from SVG content that is contained inline in the FO See SVG Images on page 107 Making an image fit a specified space To make an image fit a specified size use the height and width attributes to specify the size of the external graphic element and then use the content width and content height to fit the image to that size For example to fit an image into an area 2cm x 2cm set the width and height attributes to 2cm and set the content width and content height attributes to scale to fit as shown in Figure 16 3 96 Images Ibex PDF Creator Developers Guide Figure 16 3 g lt fo external graphic src url image jpg Scaling an Image height 2in width 2in content height scale to fit content width scale to fit gt If you only want the image reduced in size to fit the specified area and do not want it increased in size if it is smaller specify content width scale down to fit This also applies to content height If you only want the image enlarged to fit the specified area and do not want it reduced in size if it is larger specify content width scale up to fit This also applies to content height 16 3 Clipping If the image is larger than the area in which it is contained then the image may be clipped Figure 16 4 shows an image at its natural size based on the pixels and dpi val
297. tur justo Aliquam erat volutpat Maecenas nec nulla in massa consectetuer volutpat Aenean turpis nisl rutrum a posuere sit amet varius in enim Praesent risus Nam volutpat enim eget neque Maecenas a dui ac felis nonummy sollicitudin Proin iaculis Vestibulum in eros sit amet libero mollis convallis This effect is achieved by having a block which contains the text and two float elements The float elements in turn contain a block container element which has a inline progression dimension attribute defining the width of the float area Any elements inside the block container will be in the float area If a block container is not used within the float and the width of the float cannot be determined a default configurable value is used The FO for creating the above is show in Figure 11 2 Figure 11 2 is itself contained inside a float with float before which will make it appear at the top of the following page This technique is used in this manual when we do not want a large example to be split across page breaks or to interrupt the content When a float has float before its position in the PDF file is not the same as its position in the FO file in that it will be moved to the top of the next page and the blocks before and after the float will flow as if the float was not there The side on which the float occurs is specified using the float attribute This can be set to left or right to position the float at the side of the
298. tyle padding padding after padding end padding bottom padding right bottom right margin margin bottom margin left space after end indent break before id index key keep together keep with previous provisional label separation 20 0 2 Ibex PDF Creator list item Description Developers Guide This element contains the label and body of an entry ina list The height of the list item will be the taller of the label and body items it contains Child element s This element can contain the following elements list item body exactly one list item label exactly one Parent element s This element can be contained in the following elements list block Attributes The following attributes can be used on this element background attachment background image background position horizontal border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color background color background repeat background position vertical border before color border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style Elements and Attributes 255 Ibex PDF Creator
299. ubject to constraints specified for this element index range end one or more subject to constraints specified for this element inline zero or more inline container zero or more instream foreign object zero or more leader zero or more list block zero or more page number zero or more page number citation zero or more page number citation last zero or more retrieve marker one or more subject to constraints specified for this element scaling value citation zero or more table zero or more table and caption zero or more wrapper one or more subject to constraints specified for this element Elements and Attributes 261 Ibex PDF Creator Parent element s Developers Guide This element can be contained in the following elements index page citation range separator index page citation list separator index page number prefix index page number suffix wrapper basic link title block inline folio suffix folio prefix bidi override marker Attributes The following attributes can be used on this element 262 background attachment background image background position horizontal border border before style border after color border after width border start style border end color border end width border top color border top width border bottom color border bottom width border left color Elements and Attributes background color background repeat background position vertical bo
300. ues read from the image file If we specify the height of the external graphic element as 2 5cm and specify overflow hidden the image will be clipped to this height as shown in Figure 16 5 Figure 16 4 Image at natural size Figure 16 5 Clipped image Images 97 Ibex PDF Creator Guide If we specify the height of the external graphic element as 2 5cm and do not specify overflow hidden the image will not be clipped to this height and will overwrite other content as shown to the right Because the image is positioned on the same baseline as text the overflow will be at the top of the area containing the image 16 4 Image size and alignment If an image is smaller than the containing area we can control where it appears in that area using the display align and text align attributes The display align attribute controls the vertical alignment text align controls the horizontal alignment By default the image appears in the top left corner of the inline area created by the external graphic or instream foreign object element as shown in Figure 16 6 Figure 16 6 Default alignment of an image If we specify text align center the image will move to the horizontal center of the inline area as shown in Figure 16 7 Figure 16 7 Using text align center 98 Images Ibex PDF Creator Developers Guide If we specify text align right the image will move to the right of the inline area as shown in
301. uld run the nmake command as described in the previous section The XML files used in this example book xsl hello fo ship with Ibex and are in the ibexcom directory First create a new VB 6 project of type Standard EXE Use the Project gt References menu option to add a reference to the both ADO 2 5 and ibexcom tlb file The dialog should look something like the one in Figure 24 2 Using Ibex with Visual Basic and ASP 147 Ibex PDF Creator Developers Guide Figure 24 2 Adding a reference to Ibex and Microsoft ActiveX Data Objects 2 5 Library __ Microsoft Access 9 0 Object Library Microsoft Active Server Pages Object Library _ Microsoft Active Server Pages ObjectContext Object Microsoft ActiveMovie Control Microsoft ActiveX Data Objects Multi dimensional 2c Microsoft ActiveX Data Objects 2 0 Library Microsoft ActiveX Data See 2 1 pe Microsoft ActiveX Data Objects 2 6 Library Microsoft ActiveX Data Objects 2 7 Library Microsoft ActiveX Data Objects Recordset 2 7 Library Microsoft ActiveX Plugin Microsoft Add In Designer Microsoft ADO Fxt 7 for DNL and Security ai gt Location C Program Files Common Files system ado msado25 tb Language Standard Messenger Private Type Library Location C Program Files Messenger msmsgs exe 2 Language Standard _ HTML Dialog
302. umber of rows which a cell spans is set by the number rows spanned attribute Example FO for this is shown in Figure 15 20 In this example the first cell of the first row spans two rows The output from this FO appears in Figure 15 21 lt table gt lt table column column width 30 gt lt table column column width 70 background color dddddd gt lt table body gt lt table row gt lt table cell border lpt solid blue padding 2pt number rows spanned 2 gt lt block gt row 1 column 1 lt block gt lt table cell gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 1 column 2 lt block gt lt table cell gt lt table row gt lt table row gt lt table cell border lpt solid blue padding 2pt gt lt block gt row 2 column 2 lt block gt lt table cell gt lt table row gt lt table body gt Figure 15 21 spanning bwo rows 15 8 Cell separation XSL FO has two ways of processing the borders of adjacent cells depending on the value of the border collapse attribute on the table If border collapse collapse which is the default there is no gap between cells and the borders of adjacent cells are merged or collapsed to get a single border shared by both cells The rules for combining borders are explained in the XSL FO specification Broadly speaking the widest border will be used This is called the collapsed border model If border collapse separate adjacent bor
303. ure 25 116 Ibex PDF Creator Developers Guide To prevent the two spaces from being merged and get the sum of the two spaces you can use the precedence component like this space after 3cm space after precedence force Precedence can also be assigned a number If there are two spaces to be merged and they have different precedence values the one with the highest value will be used For example lt block space after 3cm space after precedence 5 gt A lt block gt lt block space before l1cm space after precedence 6 gt B lt block gt In this case the space between the two blocks will be 1cm because the second block has the higher precedence value so its space value is the one which is used Space which appears before a block at the top of a region is usually discarded To avoid this and make the space appear use the conditionality component like this space before 3cm space before conditionality retain To make matters even more complex the space after an element refers to the space between the last mark made by this element and the first mark made by the next element This means we need to consider child elements of the two elements whose space is being merged For example the block A below has a child block A2 which has a space after attribute This means when Ibex merges the space between A and B it also considers the space between A2 and B lt block space after 3cm gt A lt block space after 4
304. uses NET 1 0 ibex11 exe which uses NET 1 1 and ibex20 exe which uses NET 2 0 The command line syntax is the same for all programs In these examples we use ibex20 exe To create a PDF file from an FO file specify the file names on the command line For instance to create hello pdf from hello fo you do this ibex20 hello fo hello pdf XSLT translation The command line program will accept XML data and an XSLT stylesheet as inputs The XML will be translated to FO by the stylesheet and the results then formatted to PDF The command line syntax is ibex20 xsl xsl file xml file pdf fil So to create a PDF file from the files book xml and book xsl the command is ibex20 xsl book xsl book xml book pdf XSLT parameters can be passed to the stylesheet by adding them as name value pairs to the command line For instance if we want to define the parameter called age to the value 30 we use a command like this ibex20 xsl book xsl book xml hello pdf age 30 The use of the double quotes around the name value pair is necessary on some operating systems to force them to come through as a single parameter to the Ibex program Using Ibex 29 Ibex PDF Creator Developers Guide 5 1 2 Logging from the command line Any informational or error messages will be logged to the console To send error messages to a file as well use the logfile option For example to log errors to the file ibex log you would do
305. using the region name attribute This value is used with flow elements to specify which content goes into which region on the page Figure 4 5 lt layout master set gt The master layout lt simple page master master name simple gt element lt region body margin 2 5cm region name body background color eeeeee gt lt simple page master gt lt layout master set gt A FO file contains one or more simple page master elements each with a unique master name In this simple example we have only one Each simple page master element creates a formatting object known as a page master 12 Introduction to XSL FO Figure 4 6 The page sequence element Figure 4 7 Matching master name and master reference Ibex PDF Creator Developers Guide An example of a more complex document is the Ibex manual Each chapter begins with a page which has no header This is followed by a page which has left aligned footer then a page with a right aligned footer Each of the three possible page layouts is defined by a different simple page master element The page sequence element The page sequence element shown in Figure 4 6 defines a sequence of pages that will appear in the PDF document The master reference attribute is used to tie the content of the page sequence to a particular page layout in this case one defined previously using a simple page master When Ibex finds a page sequence element it looks at the list of known simple page mast
306. vertical border before color border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right bottom right border after precedence border start precedence block progression dimension display align empty cells height index class inline progression dimension number rows spanned width Ibex PDF Creator Developers Guide 25 5 Formatting objects for lists The objects described in this section are used to create lists Elements and Attributes 251 25 5 1 Figure 25 16 Figure 25 17 Ibex PDF Creator Developers Guide list block Description This element is used to create a list which is similar to a two column table A simple list looks like this lt list block provisional distance between starts 5cm provisional label separation 0 1lcem gt lt list item gt lt list item label end indent label end gt lt block font 8pt arial gt amp x25CF lt block gt lt list item label gt lt list item body start indent body start gt lt block gt item one lt block gt lt list item body gt lt list item gt lt list item gt lt list item label end indent label end gt lt block font 8pt arial gt amp x25CF lt block gt lt list item label gt lt list it
307. vg width 8cm height 3cm viewBox 0 0 1000 450 version 1 1 xmlns http www w3 org 2000 svg gt lt g gt lt defs gt lt linearGradient id linear_userSpaceOnUse gradientUnits userSpaceOnUse x1 100 yl 100 x2 700 y2 300 gt lt stop offset 5 stop color ff0000 gt lt stop offset 95 stop color 0000ff gt lt linearGradient gt lt defs gt lt rect fill none stroke blue x 1 y 1 width 990 height 440 gt lt g transform translate 10 50 gt lt rect fill url linear_userSpaceOnUse x 10 y 10 width 600 height 100 gt lt rect fill url linear_userSpaceOnUse x 200 y 120 width 600 height 100 gt lt g gt lt g gt lt svg gt 118 Scalable Vector Graphics SVG images Ibex PDF Creator Developers Guide producing this image When gradientUnits objectBoundingBox the specified values are relative to the bounding box of the element being filled and should be expressed as fractions of the dimensions of the element being filled The values for coordinates should be in the range 0 1 so for example specifying x1 0 starts the gradient at the left hand edge of the element being filled and specifying x1 0 2 starts the gradient at 20 of the width of that element As the gradient is positioned relative to the element being filled two element using the same gradient will appear the same regardless of the position of the element This SVG i
308. viewer display the false document title in the viewer frame rather than the file name The document title is set using the title attribute of the ibex properties element as detailed on page 138 142 Extensions Chapter 23 PDF X This chapter details Ibex specific extensions to the XSL FO XML to support creation of PDF files which conform to the PDF X standard Ibex implements the PDF X standard using the ibex pfdx element as shown in Figure 23 1 Figure 23 1 8 3 lt root xmlns http www w3 org 1999 XSL Format PDF X xmlns ibex http www xmlpdf com 2003 ibex Format gt lt ibex pdfx color profile name WideGamutRGB icc gt The Ibex extensions have a namespace which is specified using the xmlns attribute as shown above The ibex pdfx element must occur before any output is generated Using the ibex pdfx element will automatically set the document color space to CMYK The existence of the ibex pdfx element causes Ibex to create a PDF X compatible PDF file The field Settings PDFXMode used in earlier releases has been removed The attributes of the ibex pdfx element are Attribute Meaning color profile file name Full or relative path to a ICC color profile file registry name Registry Name used in the PDF OutputIntents structure If not specified this defaults to http www color org info Optional text which will become the Info value in the first OutputIntents array entry output condition Optional text whi
309. wing the use of the element see Figure 25 4 lt page sequence master master name chapter gt lt repeatable page master alternatives gt lt conditional page master reference page position first master reference chapter odd no header gt lt conditional page master reference odd or even odd master reference chapter odd gt lt conditional page master reference odd or even even master reference chapter even gt lt repeatable page master alternatives gt lt page sequence master gt Elements and Attributes 163 25 1 11 Ibex PDF Creator Developers Guide conditional page master reference Description This element associates a page master and a condition such that the page master will be used when the condition is true The conditions which are associated with this element are page position odd or even and blank or not blank Each condition on each conditional page master reference in a repeatable page master alternatives element is evaluated in turn until one is found which is true and that conditional page master reference is used Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements repeatable page master alternatives Attributes The following attributes can be used on this element master reference page position odd or even blank or not blank For an example showing
310. wrapper basic link title float footnote body static content table caption block block container 288 Elements and Attributes Ibex PDF Creator Developers Guide inline folio suffix folio prefix inline container bidi override table cell list item label list item body marker Attributes The following attributes can be used on this element retrieve class name retrieve position retrieve boundary For an example showing the use of the element see Elements and Attributes 289 25 10 6 Ibex PDF Creator Developers Guide retrieve table marker Description The marker element contains some content which will be retrieved elsewhere in the document using a retrieve table marker or retrieve marker element The retrieve table marker element is used inside a table header or table footer to specify a marker whose content will be retrieved This is described in detail on page 91 For the retrieve marker element to work its retrieve class name attribute must have the same value as the maker class name attribute used on some marker element Child element s This element can contain the following elements This element must be empty Parent element s This element can be contained in the following elements Attributes The following attributes can be used on this element retrieve class name retrieve position within table retrieve boundary within table For an example showing the use of the element see 290
311. x lime ibex maroon ibex navy ibex olive ibex purple ibex red ibex silver teal ibex white yellow ibex Hexadecimal RGB colors A color can be defined as a string of six digits preceded by a character The first two digits define the red component of the color in a range from 0 to 255 The second two digits define the green component and the last two digits define the blue component This is the same scheme for defining colors as is used in HTML CMYK colors CMYK colors are four part colors using values for cyan magenta yellow and black respectively The CMYK system is subtractive meaning that higher values mean less color unlike RGB where higher values mean more color CMYK colors are used in the printing industry to define a color which will appear the same across all media Typically a color defined using RGB will not appear exactly the same on the screen and on a 74 Colors Ibex PDF Creator Developers Guide printed page or even on two different computer screens CMYK colors are used to ensure that colors are the same on screen and on the printed page PDF files are usually created with single color scheme You would not usually mix CMYK and RGB colors in one document Note that when creating a CMYK PDF file any images included in the document should be in CMYK format A CMYK color is defined using the rgb icc function This takes eight parameters The first three define the red green and blue components o
312. yle border end color border end width border top color border top width border bottom color border bottom width border left color border left width border right color border right width padding before padding start padding top padding left relative position top left margin top margin right space before start indent alignment adjust allowed height scale baseline shift Elements and Attributes background color background repeat background position vertical border before color border before width border after style border start color border start width border end style border top border top style border bottom border bottom style border left border left style border right border right style padding padding after padding end padding bottom padding right bottom right margin margin bottom margin left space after end indent alignment baseline allowed width scale block progression dimension Ibex PDF Creator clip content height display align height index class inline progression dimension keep with previous overflow scaling method width Developers Guide content type content width dominant baseline id index key keep with next line height scaling text align Elements and Attributes 207 25 3 6 Ibex PDF Creator Developers Guide inline Description This element is used to format some text in a way which is different to the containing block such as giving it a diffe

Download Pdf Manuals

image

Related Search

Related Contents

Bien-être et santé au travail : la logique canadienne veut s`importer  2012年8月号(PDFファイル形式)  取扱説明書 レンジフード  Cosmo Multilingual 105x130mm  Allied Telesis at-9000/24 User's Manual  取扱説明書 パワー・ソース DC12/24V 電圧テスター付 品番: 33249  MyKronoz ZeBracelet 2 Instruction Manual  user manual  V-TONE GM108  L05-S006-1103_1  

Copyright © All rights reserved.
Failed to retrieve file