Questions tagged [xsl-fo]

XSL-FO (XSL Formatting Objects) is a markup language for XML document formatting which is most often used to generate printed content.

From Wikipedia

XSL-FO is part of XSL (Extensible Stylesheet Language), a set of W3C technologies designed for the transformation and formatting of XML data. The other part of XSL is XSLT (Extensible Stylesheet Language Transformations). As of December 12, 2006, the current version of XSL-FO is v1.1.

An XSL-FO document is typically generated using XSLT. An XSLT processor (such as Saxon) evaluates the templates in an XSLT stylesheet to transform your data in your XML vocabulary (or your text or JSON or Markdown or...) into XML in the XSL-FO vocabulary.

Rather than just adding styles to the fixed structure of the source document, the transformation stage is able to also reorder, duplicate, or drop parts of the source document when generating the XSL-FO document, as well as generate new content based on the structure of the source document. This is especially useful when generating tables of contents and indexes that will appear in the formatted document.

The elements in the XSL-FO document represent the formatting objects, and their attributes represent properties of the formatting objects. There are FOs for: blocks; tables and parts of tables; images; links; index entries; and so on. The properties express values such as font size, the expected space between FOs, or whether two FOs should be kept together on the same page. The XSL-FO contains the templates for the types of pages that will be used when the document is made into pages, but the XSL-FO does not contain any information about page breaks or (usually) line breaks.

XSL-FO markup can then be rendered by an FO processor, where it is most commonly used to generate document formats such as PDF, PostScript or RTF. The FO processor uses the structure of the FOs, the constraints expressed by the properties, the sizes of characters in the available fonts, the intrinsic sizes of the graphics, and other factors to lay the content of the XSL-FO out into pages. There is currently one option for viewing the pages in the FO processor application itself, but once the pages are written to a PDF file or other format, the pages can be viewed on screen or printed.

XSL-FO is well suited to applications where you have either a range of broadly similar documents that you want to format in the same style or single large document for which you want consistent styling without much manual effort. The XSLT stage takes care of specifying the right styles for the structures in your source XML and of generating the table of contents and index, and the FO processor automatically lays out the pages in accordance with the specified styles.

Links:

1806 questions
8
votes
2 answers

How to set the default language in Apache FOP

I'm generating PDF files using Apache FOP 2.1. For this I am trying to set the default language to be English. This is supposed to be verified after the creation of the PDF via Adobe Reader's option File/Properties/Advanced/Reading Options. This…
Dimitris
  • 3,975
  • 5
  • 25
  • 27
8
votes
2 answers

Where is the schema for XSL-FO?

Does anyone know how/where to download XSL-FO 1.1 schema? I not able to find an XSL-FO 1.1 schema, so many person saying not available. Please let me know if you know where to find the schema or suggest to me how to determine validation…
saravanan s
  • 175
  • 3
  • 14
8
votes
3 answers

XSL:FO, Floats in F.O.P

A while ago I found out that FOP doesn't allow you to use floats, and a few other features in Xsl-Fo 1.0. I've tried a few different ways to emulate them, but I have had no success. If anyone has had success in this, or has an idea. I would really…
Meiscooldude
  • 3,671
  • 5
  • 27
  • 30
7
votes
1 answer

Any javascript (web-based) wysiwyg editor that produces xsl:fo

I am having a hard time finding on OSS or commercial web-based (javascript) WYSIWYG* editor that produces XSL:FO. Would I would love to have the editor capable of doing... The user is presented with common text-editor interface, not unlike the…
Steve Siebert
  • 1,874
  • 12
  • 18
7
votes
1 answer

Apache FOP: zindex does not appear to be working in overlapping blocks

I am a FOP newb. I am trying to show text on top of an image by using block-container's and zindexes. The image is always on top though. If i remove the image, i can see the text, so the text is under the image. This is inside of a table cell. here…
mkoryak
  • 57,086
  • 61
  • 201
  • 257
7
votes
1 answer

Inserting a base64 encoded image into xsl-fo file while using apache-poi

I am using Apache POI to convert .doc to .fo using the WordToFoConverter class, I have converted the images in the word file to base64, but how do i append it to the xsl-fo code generated by apache-poi? Consider the sample fo file generated by…
user3683297
  • 156
  • 1
  • 8
7
votes
2 answers

Displaying SVG using XSLFO

First question from me; I'm currently fixing a graphing service that uses XSLFO to convert our syntax to FO, and converting it to PDF in the end. Previously we've been using PNG graphs from the web in the PDF exports, but this creates really ugly…
hnilsen
  • 1,987
  • 2
  • 18
  • 28
7
votes
1 answer

xls-fo fop 0.94 Using the keep-together with wrap-option="wrap"

In xls-fo fop 0.94 Using the keep-together along with with wrap-option="wrap" ignores the wrap option ? Is there a way to make them both work?
Thunder
  • 10,366
  • 25
  • 84
  • 114
7
votes
2 answers

how to align text and table data into center in xsl

i am trying to put my data and table into the center of page as shown in below table. but i have done only the table stuff remaining data alignments and adjustments i am not able to do, as i am not familiar with xsl. and here is my xsl code :
preeth
  • 365
  • 3
  • 7
  • 20
7
votes
3 answers

XSL-FO: Set fixed block height

Is there any way I can set a fixed height for a block regardless of the content within it? I have a block which sometimes displays some text but sometimes it needs to be empty and keep the same height:
Mihnea Mihai
  • 181
  • 1
  • 3
  • 18
7
votes
2 answers

How to draw horizontal line in fo-block?

i need to implement next layout: here's my code: United Nations Organisation (organisation)
user1178399
  • 1,028
  • 8
  • 17
  • 32
7
votes
2 answers

Using external CSS in XSL-FO

I am using an XSL document to create a PDF. There are some styles defined as inline. I want to move them in an external CSS file, but I am hitting a dead end. Here is my code:
Farhan
  • 2,535
  • 4
  • 32
  • 54
7
votes
1 answer

Underline block element with different font sizes without an interrupted line

I am trying to underline an block element that contains text. The block has an font-size attribute and the text within the block is surrounded by an inline element which has a different font-size attribute. Is there any way to ensure, that the line…
M.E.
  • 536
  • 2
  • 9
  • 19
7
votes
3 answers

Rounded corners in XSL-FO

Our client's request is to have tables in PDF with rounded corner. I only have Apache FOP processor at my disposal and it doesn't support the rounded corner attribute. It also doesn't support floats, so floating rounded images to left and to right…
Ariod
  • 5,757
  • 22
  • 73
  • 103
7
votes
4 answers

what are the leading XSL-FO implementations? How do I decide among them?

I'm evaluating PDF rendering technologies. XSL-FO is our chosen path because its an open standard and our source data is XML. What experiences have people had with the various implementations of XSL-FO? The implementations I've found so far…
nont
  • 9,322
  • 7
  • 62
  • 82