> Hi, 
> 
> I am using FOP from trunk, but still the warning 
> 
> fop.fonts.FontInfo (FontInfo.java:260) - Font 'Frutiger,normal,400' not
> found. Substituting with 'any,normal,400'.
> 
> My implementation
> 
>  
> fopFactory.setUserConfig(StringUtils.urlToString(userConfigUrl));
>  
> fopFactory.setFontBaseURL(StringUtils.urlToString(fontBaseUrl));
>               ua = fopFactory.newFOUserAgent();
> //            ua.setURIResolver(new FOURIResolver() {
> //              public Source resolve(String href, String base) throws
> TransformerException {
> //                  File f=new File(base,href);
> //                  return new StreamSource(f);               
> //              }          
> //  });
>             if (baseUrl != null) {
>               ua.setBaseURL(StringUtils.urlToString(baseUrl));
>               // Configuration.put("baseDir",
> StringUtils.urlToString(baseUrl));
>             }
> //            
> //            Configuration.dumpConfiguration();
>  
>         ByteArrayOutputStream byteArrayOut = null;
>         try {
>           
>           
>             byteArrayOut = new ByteArrayOutputStream();            
> //            driver.setOutputStream( byteArrayOut );
> 
>            Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, ua,
> byteArrayOut);
> 
>             // Setup JAXP using identity transformer
>             TransformerFactory factory = TransformerFactory.newInstance();
>               Transformer transformer = factory.newTransformer(); //
> identity transformer
>         
>               // Setup input stream        
>               Source src;
>               if (xmlfoDoc != null) {
>                   src = new DOMSource( xmlfoDoc );
>               } else {
>                 //encode the euro character becuase the fop rderer doesn't
> support the iso euro-character
>                 String euroEncodedString =
> xmlfoString.replaceAll(String.valueOf((char)128),"€");
>                   src = new StreamSource( new
> StringInputStream(euroEncodedString));
>               }
>               
>           Result res = new SAXResult(fop.getDefaultHandler());
> 
>               // Start XSLT transformation and FOP processing
>               transformer.transform(src, res);
> 
> Am i doing anything wrong ?
> 
> Thanks,
> Naveen 
        [Naveen Bandhu]  


On 25.05.2006 13:01:24 Johannes K?nsebeck wrote:
> 
> 
> Jeremias Maerki wrote:
> > Yes, it looks like the Ant task wasn't looked after properly. I've
> > reconnected the configuration in FOP Trunk:
> > http://svn.apache.org/viewvc?rev=408707&view=rev
> >   
> Hi Jeremias,
> thanks for looking after it. I now switched to write my own Java-app,
> which embeds fop.
> Could it be there is  the same problem?

No. In the Ant task the user configuration was not set on the FopFactory.
In your own Java application you are responsible to set the user
configuration on the FopFactory.

> I could not get it to work, till i wrote my own very stupid FOURIResolver
:
                ^^^^^^

What's "it"? What's the error message or the symptom?

>     foUserAgent.setURIResolver(new FOURIResolver() {
>                 public Source resolve(String href, String base) throws
>     TransformerException {
>                     File f=new File(base,href);
>                     return new StreamSource(f);               
>                 }          
>     });       

Should really not be necessary.

> 
> Before  i tried a lot with :
> 
>     fopFactory.setFontBaseURL(...);      
>     foUserAgent.setBaseURL(...);       
> 
> How do I use them ? I tried "file:/home/..." or "file:///home/..." or
> without the protocol : "/home/..." ? but nothing worked (fonts/gfx).
> Sorry, I don't have the code to show the problem anymore.

file:///home/... should have worked. Try absolute paths in the user
configuration file instead of trying to set the base URLs in code.

> > It could probably do with some extra attention. For example, doing XSLT
> > and FOP in one step to improve performance and to avoid temporary files.
> > Want to give it a shot? Patches are always welcome.
> >   
> Ok, I will try.
> Patches? Well, maybe one day when I'm grown up and a *real* Java-Coder ;)

:-)

<snip/>
> > On 22.05.2006 10:03:24 Johannes K?pnsebeck wrote:
> >   
> >> Hi,
> >> I have a project where I use ant to do some xslt and fop
> >> transformations. Everything worked well till i switched to fop 0.92b.
> >> Now my fonts aren't found. It works from commandline, too. Is the
> >> anttask broken?
> >> Ant log:
<snip/>



Jeremias Maerki




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to