xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pascal Sancho <pascal.san...@takoma.fr>
Subject Re: Problem that could lose me my job
Date Fri, 03 Feb 2012 13:53:04 GMT
Hi,

you should read FOP trace (from stdin or stderr).
This reveals what is wrong in your XSL-FO: FOP throws a lot of
exceptions, that prevent it to generate any PDF.

At least, your app should report you if PDF has been generated or not.


Le 03/02/2012 14:32, Theresa Jayne Forster a écrit :
> Why would that make the output PDF invalid to Adobe and not to Sumatra pdf?
> 
> Kindest regards
> 
> Theresa Forster
> 
> Hi,
> 
> I've just opened the FO file in oXygen, and it throws up a number of errors:
> 
> @ margin-top not allowed in fo:region-start
> @ z-index not allowed in fo:region-body
> @ z-index not allowed in fo:region-before
> @ z-index not allowed in fo:region-after
> 
> ... about 20 or so in the fo:simple-page-master section
> 
> HTH
> 
> David
> 
> Sorry, I was under pressure to roll back the servers that we had just
> upgraded to use the fop 1.0 system.
> 
> One of the failing PDFs is at http://www.inbrand1.co.uk/failsinadobe.pdf
> 
> The FO that generated it is at http://www.inbrand1.co.uk/failsinadobe.fo
> 
>  
> 
> The fopconfig has nothing except font configurations in it. A couple
> have kerning xml files as they produce incorrectly without.
> 
>  
> 
> The routine that produces the PDF is as follows
> 
>  
> 
> public File generatePDFromFO(File foFile) {
> 
>         OutputStream ot = null;
> 
>         BufferedOutputStream out = null;
> 
>         File tempFile = null;
> 
>         try {
> 
>             tempFile = File.createTempFile("W2P", ".pdf");
> 
>             out = new BufferedOutputStream( new FileOutputStream(tempFile));
> 
>             fopFactory.setStrictValidation(false);
> 
>             DefaultConfigurationBuilder cfgBuilder = new
> DefaultConfigurationBuilder();
> 
>             Configuration cfg = cfgBuilder.buildFromFile(new
> File("/fopconfig.xml"));
> 
>             fopFactory.setUserConfig(cfg);
> 
>             FOUserAgent useragent= fopFactory.newFOUserAgent();
> 
>             useragent.setTargetResolution(300);
> 
>             Fop fop =
> fopFactory.newFop(MimeConstants.MIME_PDF,useragent,out);
> 
>             TransformerFactory factory = TransformerFactory.newInstance();
> 
>             Source src = new StreamSource(foFile);
> 
>             Transformer transformer = factory.newTransformer();
> 
>             Result res = new SAXResult(fop.getDefaultHandler());
> 
>             transformer.transform(src, res);   
> 
>         } catch (IOException ioe) {
> 
>             LOGGER.error("IOException ",ioe);
> 
>             ioe.printStackTrace();
> 
>         } catch (SAXException se) {
> 
>             LOGGER.error("Sax Exception ",se);
> 
>             se.printStackTrace();
> 
>         } catch (ConfigurationException ce) {
> 
>             LOGGER.error("Configuration Exception ",ce);
> 
>             ce.printStackTrace();
> 
>         } catch (TransformerConfigurationException tce) {
> 
>             LOGGER.error("Transformer Configuration Exception",tce);
> 
>             tce.printStackTrace();
> 
>         } catch (TransformerException te) {
> 
>             LOGGER.error("Transformer Exception ",te);
> 
>             te.printStackTrace();
> 
>         }
> 
>         return tempFile;
> 
>     }   
> 
>  
> 
>  
> 
> Fop config file here
> 
>  
> 
> <fop xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
> 
>                 <strict-configuration>true</strict-configuration>
> 
>                 <base>C:\preprocessor\filestore\</base>
> 
>  
> 
>                 <font-base>/Fonts</font-base>
> 
>  
> 
>                 <cache-file>/fop-cache</cache-file>
> 
>                 <!--
> 
> ************************************************************************
> 
>   Add fonts here
> 
> ************************************************************************
> 
> -->
> 
>                 <renderers>
> 
>                                 <renderer mime="application/pdf">
> 
>                                                 <fonts>
> 
>                                                                 <font
> embed-url="FRUTL___.TTF" kerning="yes" metrics-url="FrutigerLight.xml">
> 
>                                                                  
> <font-triplet name="Frutiger" style="normal" weight="200"/>
> 
>                                                                
> </font>                                                                       
       
> 
>                                                                 <font
> embed-url="FRUTB___.TTF" kerning="yes">
> 
>                                                                  
> <font-triplet name="Frutiger" style="normal" weight="400"/>
> 
>                                                                
> </font>               
> 
>                                                                 <font
> embed-url="tfarrow-medium.TTF">
> 
>                                                                  
> <font-triplet name="TFArrow" style="normal" weight="400"/>
> 
>                                                                
> </font>               
> 
>                                                                 <font
> embed-url="HELVNBL_.TTF">
> 
>                                                                  
> <font-triplet name="HelveticaNeue" style="normal" weight="900"/>
> 
>                                                                
> </font>                                                               
> 
>                                                                 <font
> embed-url="helveticaneue_85hv.ttf">
> 
>                                                                  
> <font-triplet name="HelveticaNeue" style="normal" weight="800"/>
> 
>                                                                
> </font>                                                               
> 
>                                                                 <font
> embed-url="HELVNBI_.TTF">
> 
>                                                                  
> <font-triplet name="HelveticaNeue" style="italic" weight="700"/>
> 
>                                                                
> </font>                                                               
> 
>                                                                 <font
> embed-url="HELVNM__.TTF">
> 
>                                                                  
> <font-triplet name="HelveticaNeue" style="normal" weight="500"/>
> 
>                                                                
> </font>               
> 
>                                                                 <font
> embed-url="HELVNI__.TTF">
> 
>                                                                  
> <font-triplet name="HelveticaNeue" style="italic" weight="400"/>
> 
>                                                                
> </font>               
> 
>                                                                 <font
> embed-url="lte50259.ttf">
> 
>                                                                  
> <font-triplet name="HelveticaNeue" style="normal" weight="400"/>
> 
>                                                                  
> <font-triplet name="HelveticaNeue" style="roman" weight="400"/>
> 
>                                                                
> </font>               
> 
>                                                                 <font
> embed-url="HELVNL__.TTF">
> 
>                                                                  
> <font-triplet name="HelveticaNeue" style="normal" weight="300"/>
> 
>                                                                
> </font>               
> 
>                                                                 <font
> embed-url="HELVNT__.TTF" kerning="yes" metrics-url="HelveticaNeueLight.xml">
> 
>                                                                  
> <font-triplet name="HelveticaNeue" style="normal" weight="200"/>
> 
>                                                                
> </font>               
> 
>                                                                 <font
> embed-url="HELVNUL_.TTF">
> 
>                                                                  
> <font-triplet name="HelveticaNeue" style="normal" weight="100"/>
> 
>                                                                
> </font>               
> 
>                                                                 <font
> embed-url="LTe50872.ttf">
> 
>                                                                                
> <font-triplet name="HelveticaNeueCond" style="normal" weight="400"/>
> 
>                                                                 </font>
> 
>                                                                 <font
> embed-url="LTe50874.ttf">
> 
>                                                                                
> <font-triplet name="HelveticaNeueCond" style="normal" weight="700"/>
> 
>                                                                
> </font>                                                               
> 
>                                                 </fonts>
> 
>                                 </renderer>
> 
>                                 <renderer mime="image/png">
> 
>                                  
> <transparent-page-background>true</transparent-page-background>
> 
>                                   <fonts><auto-detect/></fonts>
> 
>                                 </renderer>                     
> 
>                 </renderers>   
> 
> </fop>
> 
>  
> 
> Kindest regards
> 
>  
> 
> 
> Theresa Forster
> 
> Senior Software Developer
> 
> 
>  
> 

-- 
Pascal

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message