xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Afshartous, Nick" <nick.afshart...@proactcorp.com>
Subject RE: page number alignment in TOC
Date Tue, 01 Apr 2003 19:36:52 GMT

> Afshartous, Nick wrote:
> > I know that the issue of right-justifying 
> > page numbers in a TOC is a documented 
> > limitation
> > 
> >     http://xml.apache.org/fop/faq.html#page_number_align
> > 
> > but I was wondering if anyone has managed to work
> > around this.  In other words has anyone found
> > a technique for making the page numbers
> > look right-justified in a TOC ?  Thanks 
> > for any info.

> From: J.Pietschmann [mailto:j3322ptm@yahoo.de] 
> This is fixed in CVS.

I built a JAR using xml-fop_20030401173520.tar.gz
but then got the exception below.  The only change
was to add the call to Driver.initialize)).

This error did not occur with fop-0.20.4.jar.   

Please advise, thanks.

    Nick

java.lang.NullPointerException
	at org.apache.fop.pdf.PDFDocument.outputHeader(PDFDocument.java:849)
	at
org.apache.fop.render.pdf.PDFRenderer.startRenderer(PDFRenderer.java:297)
	at
org.apache.fop.apps.LayoutHandler.startDocument(LayoutHandler.java:182)
	at
org.apache.fop.fo.FOTreeBuilder.startDocument(FOTreeBuilder.java:182)
	at
org.apache.fop.tools.DocumentReader.parse(DocumentReader.java:459)
	at org.apache.fop.apps.Driver.render(Driver.java:617)
	at org.apache.fop.apps.Driver.run(Driver.java:664)
	at com.proactcorp.docgen.DocGen.fo2pdf(DocGen.java:98)
	at com.proactcorp.docgen.DocGen.main(DocGen.java:74)
Exception in thread "main" 


 private static ByteArrayOutputStream fo2pdf(Document foDocument) {

        DocumentInputSource fopInputSource = new DocumentInputSource(
                                                         foDocument);
        ByteArrayOutputStream out = new ByteArrayOutputStream();        
        Driver driver = new Driver(fopInputSource, out);
        driver.initialize();
        driver.setRenderer(Driver.RENDER_PDF);
    
        try {
           
            driver.run();

        }
        catch (java.io.IOException e) {
            System.out.println("DocGen: IOException");
        }
        catch (org.apache.fop.apps.FOPException e) {
            System.out.println("DocGen: FOPException");
        }

        return out;
        
    }

Mime
View raw message