xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Theresa Forster" <theresaja...@minuet-uk.com>
Subject No output
Date Wed, 19 Dec 2018 12:30:07 GMT
I am following the examples on the FOP site but its not producing any output
- png file is 0 bytes and pdf is 1 k but is showing as corrupt, 

 

What could be the problem

 

My code

 

BufferedOutputStream bos = new BufferedOutputStream(new
FileOutputStream("out.pdf"));
Result res = new
SAXResult(service.getFactory().newFop(MimeConstants.MIME_PDF,
bos).getDefaultHandler());
transformer.transform(xml, res);
bos.flush();
bos.close();
File output = new File("out.pdf");

 

The FO file is an example file normal.fo from the official examples

 

(just the start here)

 

<?xml version="1.0" encoding="utf-8"?>

 

 

<!-- example for a simple fo file. At the beginning the page layout is set.

Below fo:root there is always

- a single fo:layout-master-set which defines one or more page layouts

- an optional fo:declarations,

- and a sequence of one or more fo:page-sequences containing the text and
formatting instructions -->

 

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

 

                <fo:layout-master-set>

                <!-- fo:layout-master-set defines in its children the page
layout:

                                                the pagination and layout
specifications

                                                - page-masters: have the
role of describing the intended subdivisions

 
of a page and the geometry of these subdivisions

                                                - page-sequence-masters:
have the role of describing the sequence

 
of page-masters that will be used to generate

 
pages during the formatting of an fo:page-sequence

 

                -->

 

 

Any suggestions?

 

Theresa


Mime
View raw message