2、3. try { 4. // set base FOP FONT directory. The font config stuff will be looked for here 5. Configuration.put("fontBaseDir", config.getServletContext().getRealPath("/WEB-INF/jpivot/print/")); 6. // get the physical path for the config file 7.
3、 String fopConfigPath = config.getServletContext().getRealPath("/WEB-INF/jpivot/print/userconfig.xml"); 8. // load the user proerties, contining the CustomFont font. 9. new Options(new File(fopConfigPath)); 10. 11. } catch (FOPException e) { 12.
4、 e.printStackTrace(); 13. logger.info("FOP user config file not loaded"); 14. } catch (Exception e) { 15. e.printStackTrace(); 16. logger.info("FOP user config file not loaded"); 17. } 18. } 19. 2.在WEB-INFjpivotprint目录下建立userconfig.xml文件。