Example: stock market

XSL-FO Tutorial - Ecrion

2007 Ecrion Software, TutorialXSL-FO Tutorial2 2007 Ecrion Software, of ContentsPart IXSL-FO 41 What is 143 Flow 164 Inline Text 246 Color 298 Absolut 4915 Miscellaneous Inline 53 Index Entries .. 55 Encryption .. 57 Metadata .. 58 Digital Signatures .. 60 Barcodes .. 63 Extended Layout Elements .. 68 AFP Extensions .. 70 Filter/Crop/Transform .. 72 Insert Document .. 73 Multicolumn Block .. 75 Viewer Preferences .. 76 Tab Extensions .. 78 Page Settings .. 80 Color Profile .. 83 Postscript Device Setup .. 85 Outline .. 88 Auto Adjust Regions .. 90 Tag Group .. 91 Page Number Extensions .. 93 Overflow Errors .. 95 Keep Together Extension .. 9717 Appendix A - ColorsXSL-FO Tutorial3 2007 Ecrion Software, TutorialThis document is designed to help XML programmers to develop XSL-FO documents to be rendered using XFRendering XF Rendering Server 2008XF Rendering Server is a highly scalable, enterprise class rendering product.

• XSL-FO - (XSL Formatting Objects) a language that can be used in XSLT for the purpose of "presenting" the XML. XSL Formatting Objects is a W3C standard used by Ecrion XF Rendering Server 2008 to produce print-

Tags:

  Tutorials, Xslt, Xsl fo tutorial

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of XSL-FO Tutorial - Ecrion

1 2007 Ecrion Software, TutorialXSL-FO Tutorial2 2007 Ecrion Software, of ContentsPart IXSL-FO 41 What is 143 Flow 164 Inline Text 246 Color 298 Absolut 4915 Miscellaneous Inline 53 Index Entries .. 55 Encryption .. 57 Metadata .. 58 Digital Signatures .. 60 Barcodes .. 63 Extended Layout Elements .. 68 AFP Extensions .. 70 Filter/Crop/Transform .. 72 Insert Document .. 73 Multicolumn Block .. 75 Viewer Preferences .. 76 Tab Extensions .. 78 Page Settings .. 80 Color Profile .. 83 Postscript Device Setup .. 85 Outline .. 88 Auto Adjust Regions .. 90 Tag Group .. 91 Page Number Extensions .. 93 Overflow Errors .. 95 Keep Together Extension .. 9717 Appendix A - ColorsXSL-FO Tutorial3 2007 Ecrion Software, TutorialThis document is designed to help XML programmers to develop XSL-FO documents to be rendered using XFRendering XF Rendering Server 2008XF Rendering Server is a highly scalable, enterprise class rendering product.

2 It can be used to automate thecreation of electronic documents like technical manuals, brochures, proposals, business reports containingcharts and graphs, by dynamically generating them from Rendering Server supports two major industry standards: XSL-FO (Extensible Style LanguageFormatting Objects) describing how an XML document should be formatted for a variety of media as well asSVG (Scalable Vector Graphics) used to describe bidimensional vector and mixed vector/raster graphics Features Supports XSL, XSL-FO , SVG and SVG Zipped, XPS, XChart, XML, HTML, XHTML formats, Microsoft Office2003 and Word 2008 documents as input. Produces PDF, AFP, XPS, SVG, PostScript, HTML, Image Files (PNG, GIF, JPEG, BMP, TIFF), IOCA, PCL, INXand Text Files. The first XSL-FO formatter in the world able to generate XML Paper Specification(XPS) documents. Supports partial document rendering. Supports Type1, Type 1 with Postscript Glyphs (OTF), TrueType, AFM font embedding and private fonts.

3 Scalable server architecture that can run across multiple CPUs, meeting the high performance needs of yourapplications. Is accessible from a multitude of development environments: C++, VB, ASP and ASPX, .NET and JavaApplication Programming Interfaces(API's). Multiprocessor/Multithreaded (multiple documents can be processed in the same time; threads can beprocessed on different CPUs if available). Is available in 32 bit and 64 bit editions. Supports 128 bit strength encryption of generated PDF files. Has advanced pagination and layout capabilities. Advanced SVG support, with additional support for charts and barcodes Can achieve significant speed improvements by enabling the use of more system memory. Generates print-ready PDF documents, compliant with PDF/X standards and with full color managementsupport (ICC profiles). Includes XF Designer XSL-FO authoring : For the latest features and updates please visit our and SupportSend error reports, feature requests and comments about the XF documentation or samples directly to the Technical Support information about support options can be found on the Ecrion Tutorial4 2007 Ecrion Software, is XSL-FOXSL-FO is an XML language designed for describing all visual aspects of paginated documents.

4 The wellknown HTML is another language for specifying formatting semantics, but is more usable for documents thatare presented on screen, and less for materials created for printing, because it does not support paginationelements like headers and footers, page size specifications, footnotes, is part of XSL language family: xslt - (XSL Transformations) a language for transforming XML. XSL-FO - (XSL Formatting Objects) a language that can be used in xslt for the purpose of "presenting"the Formatting Objects is a W3C standard used by Ecrion XF Rendering Server 2008 to produce print-ready documents in PDF, AFP, Postscript, TIFF and other Designer can edit XSL-FO documents in the same way like a HTML editor can edit HTML following image depicts the steps required to produce a PDF document (or any other supported outputformat) using XSL:As you can see the XML data is transformed together with the XSL stylesheet to produce an XSL-FO documentand the document is then converted to hard it is to learn?

5 The XSL-FO language uses CSS (Cascading Style Sheets) to describe formatting attributes like fonts, colorsand borders, so from this point of view, it should be easy to learn by HTML developers. This manual will helpyou understand the language and accomplish more complicated is the traditional Hello World, XSL-FO style:<fo:root xmlns:fo=" "> (1) <fo:layout-master-set> (2)<fo:simple-page-master master-name="LetterPage" page-width=" " page-height="1in"> (3)<fo:region-body region-name="PageBody" margin=" "/> </fo:simple-page-master> </fo:layout-master-set> XSL-FO Tutorial5 2007 Ecrion Software, Inc.<fo:page-sequence master-reference="LetterPage"> <fo:flow flow-name="PageBody" font-family="Times New Roman" font-size="24pt"> <fo:block> Hello World </fo:block> (4)</fo:flow> </fo:page-sequence> </fo:root>There are several things to notice:(1) Any XML document must have only one root, and XSL- FO makes no exception.

6 The root element for anXSL-FO document is fo:root. The word "fo" before column character ":" is called a namespace prefix. AnXML namespace is collection of names identified by an unique URL. It's main role is to avoid collisions when asingle XML document contains elements and attributes defined by multiple software modules. The "fo"namespace prefix is linked with an unique URL, in this case " " using xmlns attribute. This syntax is based on W3C XML Namespace Spec.(2)(3) The pages structure is defined using fo:layout-master-set; more about this in the chapter Pagination. For now, is enough to say that it declares one type of page, x 8 inches (US Letter).(4) The "Hello World" paragraph is added into the result of rendering should be identical with the following figure: Figure convert this document into PDF, you can use XF Designer. Open the document and generate the PDF fromthe tools menu.

7 Or you can use , a console program located in "C:\Program Files\EcrionSoftware\XF Rendering Server 2008\bin". The command line -fo -pdf C:\Temp\ command line flag -pdf is optional; if not present render will generate a PDF file with a name identicalwith the input file's name and .pdf Tutorial6 2007 Ecrion Software, XSL-FO , paragraphs are created using fo:block attributes can be set on a paragraph: Horizontal alignment is controlled by text-align attribute. Borders are set using borders attribute. Font is set using font-family, font-size, font-weight, etc. Spacing between two adjacent paragraphs is set using space-before and space-after.<fo:root xmlns:fo=" "> <fo:layout-master-set> <fo:simple-page-master master-name="LetterPage" page-width="5in" page-height="2in"> <fo:region-body region-name="PageBody" margin=" "/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="LetterPage"> <fo:flow flow-name="PageBody" font-family="Arial" font-size="10pt">(1) <fo:block text-align="justify" space-after=" " (2)border="3pt solid green" padding="5pt"> This is the first paragraph of justified text.

8 Notice how text fills all available space for all lines except the last alignment of the last line is controlled by text-align-last property. </fo:block> <fo:block space-before="1cm" border="3pt ridge blue" padding="5pt">This is the second paragraph. This block is left aligned. </fo:block> </fo:flow> </fo:page-sequence> </fo:root>In this example, we have two paragraphs of justified text, surrounded by borders, with 2 centimeters distancebetween them. The result of rendering should be identical with the following figure: Figure are several things to notice:(1) We set the font to Arial, 12 points height on the parent fo:flow Tutorial7 2007 Ecrion Software, Inc.(2) The distance between paragraphs is not additive; instead, the largest value will prevail. If a fo:block isthe first or the last element in a page, you will also notice that the space is not present anymore!

9 Thisbehavior is controlled by and attributes. If set to"retain", the corresponding space will not be AlignmentHorizontal alignment of text is controlled by two attributes: text-align which will set the alignment for all linesof text, except the last one, which is set to text-align-last. This is important to remember, because if your paragraph has only one line of text, you have to usetext-align-last to set the values for text-align and text-align-last are: left (the default) to perform alignment to the right. right, to perform alignment to the right. center, to center the paragraph. justify, to justify the text, so that if fills the whole alignment of text is controlled by display-align attribute. This attribute can have the following values: auto (the default) before center afterFontsThere are six properties that control the aspect of text:font-family, font-style, font-variant, font-weight,font-size, set the font face, you use font-family attribute.

10 For example font-family="Arial" will specify that Arial fontmust be multiple font families are specified, the renderer will pick the first available, so you should list the fonts fromthe most specific to the most generic. For example, font-family="Arial, Helvetica" will select "Helvetica" if"Arial" is not present in the weight of the font can be specified using font-weight attribute. You can set it to either an absolute value("bold" or "normal"), or to a value relative to parent element's font weight ("bolder" or "lighter").To specify the font size, use font-size attribute. This size can be a length (1cm, , 10pt, etc) or apercentage ( , 50%) from parent element's very important, and often misused property is line-height. This property determines the minimumline-height for a block element. The default value for line-height is 120%, that is, the line will be 20% tallerthan the text.


Related search queries