BOOKMARK & SHARE Bookmark and Share
RSS RenderX RSS
The Future of Your Document Is Here
RenderX logo
Contact Us

Download Now!

XEP 4
RenderX offers all our software on a trial basis so that our prospects can easily see why thousands of customers have selected XEP to meet their needs.

Why not download a trial version today and see for yourself!

CoolTools

The RenderX sales team created several cool tools - called CoolTools - to stimulate thought and exchange new ideas about things that can be accomplished with XSL FO (XSLFO) and RenderX XEP:


The Document Magnifier

We put together a quick XSL for magnifying documents. As with most CoolTools, this one relies on the XEP Intermediate Format (XEPOUT). There are several ways to get XEPOUT format. To format a modified XEPOUT, one just passes it back through RenderX XEP. The document is not recomposed, only the final output is generated as this final process from XEPOUT to output (like PDF or PostScript) is very fast and takes very little memory.

What is not documented at the above link is that there is also an XEPOUT element called "xep:transform". It is not documented, because, while it is built into the XEP Engine, there are no constructs in XSL-FO that currently cause this element to be created. However, that neither stops us from telling you about it nor prevents you from using it in various projects.

The <xep:transform> element allows you to apply affine transformation to all content that follows this element. Since we are looking for scaling, we could insert something like this in the XEPOUT document to scale the elements that follow:

<xep:transform a="2" b="0" c="0" d="2" e="0" f="0"/>

If the above <xep:transform> element inserted into the XEPOUT, it would scale all content following it. The scale would be "2" (double the size), because "a" and "d" (scale X and scale Y respectively) are 2. You should note that all attributes work – this element allows you to scale, translate, and rotate.

We also need to change the page dimensions to accommodate the size. We could write an easy identity-translate to operate on XEPOUT and scale pages. By the way, choose different values for scale X and scale Y, if unproportional scaling is what you want.

Give it a try!

Full text is available here.

Using Google Maps API and RenderX to insert dynamic maps in PDF

This example is a complete XSL template for generating a Google map image on the fly.


Disclaimer:  You should always review Google's policy. Google has restrictions about what you can do with their APIs. This example is provided for educational purposes only.

This is a general set of XSL templates to generate a Google Map from source address information. This process works by first submitting the address to the Google Geocoding Service which returns an XML file containing additional information. This additional information includes the latitude and longitude of the specified location. This XML is loaded into a variable which is an internal XML document and the nodes processed to extract the needed data. The coordinates are parsed from the XML document and passed to the Google Static Maps API to generate an image with a marker at the address provided. Various other parameters can be set, including the zoom factor, image size, and map type.

A sample PDF is available here.

Full text is available here.

Using Google Chart API and RenderX to generate dynamic charts

This CoolTool XSL produces the formatted URL for an <fo:external-graphic/> object. It takes as parameters all the information needed to format a nice looking pie chart.

Google has a publicly available chart server. You can get more information on the Google Chart Server API here.

All the parameters which govern the look of the pie chart are passed through the URL, and the Google Chart API returns a PNG image of the chart. These parameters include the data and labels, as well as the colors, size, orientation, and type of chart (2D, 3D, and concentric for pies).

While we do have some nice style sheets we use to generate dynamic SVG pie charts and bar charts, we also wanted to share you with you this simple, reusable style sheet that you can include in any project.

A sample PDF is available here.

If you wish to play for yourself, here is some sample data which contains sample XSL and the CoolTool XSL.

Full text is available here.

A style sheet for converting Excel XML format to XSL FO (XSLFO) tables

Our internal invoicing system used a method of converting Microsoft Excel to XML data and passing that data to RenderX XEP to format. So we decided to bump it up a little and put together an XSLT to convert Microsoft Excel's XML format to XSL FO (XSLFO). Since Microsoft Office 2003, Excel has had a function to save an Excel spreadsheet in XML format. This XML file is a self-contained file: It has all the data and all the styling in the structured content.

We decided that we would focus on the Print Area range – that is the only information that is extracted from a spreadsheet. This also allows us to use Excel's Print Titles feature to create XSL FO (XSLFO) table headers. We are not doing any calculations, so we just skip the formulas and use the stored values to create our table. Lastly, we implemented it such that you can just reference the XML Excel document and use the document() function to process this whole thing to an XSL FO (XSLFO) table.

This example is just a basic example, and you are welcome to improve it.

Sample PDF output is available here.

Download the package here.

Full text is available here.

"N-up" processing of pages

This example shows how to place several pages on one page (sheet) by manipulating XEPOUT format.

In the "n-up" case, the custom transform goes through the XEPOUT for any document and makes a new XEPOUT with say 4 pages for each page. Copying <page> elements from the input document and pre-pending two supported XEPOUT elements -- <transform> to move the page locations and <translate> to scale the page content to the proper size (in the case of 4-up, 1/4th the original dimension).

Short primer on XEP Intermediate Format

RenderX XEP produces output from XSL FO (XSLFO):

XML + XSL -> XSL FO -> XEP Software -> PDF, Postscript, AFP, XPS, XHTML, and SVG ...

Most people write XSL to get to XSL FO from XML, others write XSL FO directly from some application. RenderX gets from XSL FO (XSLFO) to output by producing internal structures of the page output representation – the document result tree. This is called the XEP Intermediate Format or XEPOUT for short. XEPOUT can be serialized to disk.

If we "peak under the covers" into "XEP Software", we would see:

XML + XSL -> XSL FO -> (XEP Formatter -> XEPOUT -> XEP Generator) -> PDF, Postscript, ...

The XEPOUT file is an XML that represents the entire document structure. It contains a <document> element and also <page> elements and <text> elements and <image> elements and much more. As long as you do not violate the XEPOUT format, you can manipulate its content and send it back to XEP.

So consider the applications here:

XML+XSL -> XSL FO -> XEP Formatter -> XEPOUT -> My Custom Transform/Application -> New XEPOUT -> XEP Generator -> PDF, Postscript, ...

There are many things that can be done – from the very, very simple to the very complex. There have been many other applications written that leverage this ability. Use your imagination… and, if you have something that you think cannot be done, ask us.

Full text is available here.

Scale to fit images

Some users need a way to scale down images to fit within a constrained space in both dimensions. We have created a solution set that uses the current technology for this purpose.

The basic solution consists of running RenderX XEP in a way to process only the images and gather information on the actual image size from the XEP Intermediate Format (XEPOUT). Then one can run RenderX XEP again with the main style sheet and use that information when formatting the document. This can of course be done in a tool chain with two commands (instead of one) or through the API and passing parameters.

All of this can be executed from a simple batch (.BAT) file. The XEPOUT file is generated automatically, used in the second transformation, and then deleted. In the case of some users who are dynamically generating PDFs, certainly the XEPOUT file can be generated in memory and passed as a parameter to the second transformation.

Just sample XML and XSL without images is available here.

The whole package with images is available here. (7 MB)

Sample output in various sizes:

Full text is available here.

News

May 23, 2016
XEP 4.25 released

PDF/UA compliance, RGBA;
new algorithms: font parsing,
linearization, image caching;
PDF forms: comb field support.
More news...


April 19, 2016
EnMasse 3.0 released

New load balancer:
Improved performance: +17%;
Improved stability and security;
HTTPS support for SOAP server.
More news...


October 8, 2015
VDPMill 4.1 released

Unattended installation support.
EnMasse 2.4 / XEP 4.24.
More news...


August 6, 2015
EnMasse 2.4 released

Improved stability on Linux;
3rd-party XSLT-transformers;
Access-Control-Allow-Origin:
cross-domain formatting.
More news...


February 18, 2015
XEP 4.24 released

New RenderX extension:
page scaling in PDF backend;
bugfixes related to:
SVG, PDF images, accessibility.
More news...


RenderX RSS RSS: Subscribe

Add to Google Add to MyYahoo!