Hey

Another beginner question

I use fop 0.92 but I'am consedreing moving to trunk soon

I tried to generate png from a fo file

using command line works fine :
 java -jar fop.jar -fo /tmp/test.fo -png ../../../web/uploads/test.png

give severals png test.png, test2.png - one png for each page.

I am now trying using the API trought php-java-bridge (quite similar if we where using java)

here my code :

              // Instanciate & configure FOP user agent
$fop_factory = new JavaClass ('org.apache.fop.apps.FopFactory');
              $fop_factory = $fop_factory->newInstance();
$fop_factory->setUserConfig(new Java('java.io.File', sfConfig::get('sf_app_config_dir').'/fop.xconf'));
              $fop_ua = $fop_factory->newFOUserAgent();

               /*
               * Setup output stream.  Note: Using BufferedOutputStream
* for performance reasons (helpful with FileOutputStreams).
               */
$out = new Java('java.io.FileOutputStream', $path_to_png);
              $out = new Java('java.io.BufferedOutputStream', $out);

              // Construct fop with desired output format
$fop_mime_constants = new JavaClass ('org.apache.fop.apps.MimeConstants'); $fop = $fop_factory->newFop($fop_mime_constants- >MIME_PNG, $fop_ua, $out);

              // Setup JAXP using identity transformer
$transformer_factory = new JavaClass ('javax.xml.transform.TransformerFactory'); $transformer_factory = $transformer_factory- >newInstance();
              $transformer = $transformer_factory->newTransformer();

              // Setup input stream
$src = new Java ('javax.xml.transform.stream.StreamSource', $path_to_fo);

// Resulting SAX events (the generated FO) must be piped through to FOP $res = new Java('javax.xml.transform.sax.SAXResult', $fop->getDefaultHandler());

              // Start XSLT transformation and FOP processing
              $transformer->transform($src, $res);

the problem is just the first png is generated  ! :-(

An idea ?

Thank you for your advices and making fop wich is great

Olivier


--
Olivier Mansour      http://www.clever-age.com
Clever Age Lyon - conseil en architecture technique
GSM: +33 6 11 03 23 77  Tél: +33 4 78 89 46 45

Clever Age vous invite à ses petits déjeuners du Jeudi
http://www.clever-age.com/actualites/petits-dejeuners/



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

Reply via email to