Hi John,

I had the same problem a month ago I think we could put this in the offical
doc.

This was the respone I had from Denis Kranjcec and it works fine.

Options options = null;
String pathFonts = null;

options = new Options(new File("userconfig.xml"));

Driver driver = new Driver();

driver.setRenderer(Driver.RENDER_PDF);

driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");

driver.addPropertyList("org.apache.fop.fo.StandardPropertyListMapping");
driver.setOutputStream(out);
driver.buildFOTree(createParser(), foFile);
driver.format();
driver.render();

I hope this helps you.

Emmanuel

-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Envoyé : mercredi 25 juillet 2001 21:25
À : [EMAIL PROTECTED]
Objet : loading userconfig.xml programmatically


archive is off-line, can't find a fop-user list, project due tomorrow, same
old story...

Ok, I've setup a Type1 and TTF barcode font for use with FOP... updated
userconfig.xml... and have a servlet that is serving up PDF documents via
FOP.  My FO document has some barcode font references.  How do I read
userconfig.xml, in my servlet, so the barcode font will embed/render?

Can't find any doc or example of this.  I just started wading through the
code, trying to track it down from the  "Fop -c userconfig.xml" command line
type argument.

Options.loadUserconfiguration( strFile )        looks promising... is that a
typo in the method name?
Options.loadUserconfiguration( File )   creates ConfigurationReader and
starts() it
Options.loadStandardConfiguration()     is this called on "new Driver();"?
defaults to /conf/config.xml

Also, I'm pretty confused by the fop-uml documentation... it shows Driver as
having loadStandardConfiguration() and loadUserconfiguration()... but they
are in Options.java source file. Sup with that?  I know, when in doubt go to
the source<g>

/jhd


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


========================================================================= 
Ce message et toutes les pièces jointes sont propriété de VALTECH et 
susceptibles de contenir des informations confidentielles à l'intention 
exclusive de ses destinataires. Si vous avez reçu ce message par erreur 
ou si celui ci vous est parvenu incomplet ou altéré, merci d'en avertir 
l'expéditeur par retour.Toute utilisation, diffusion ou publication non 
expressément autorisée par nous par écrit est strictement interdite. 
 -------------------------------------------------------------------------- 
This message and any attachments are Valtech property and may contain 
iconfidential information intended solely for the addressees. If your are 
not the intended recipient of this message or if you have received it 
uncomplete or altered, please notify the author by replying to his e-mail 
immediately. Any unauthorised use, diffusion or dissemination not 
expressly authorised by us in writing is strictly prohibited. 
========================================================================= 
Copyright Valtech 2000 



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

Reply via email to