public void saveAsPDF ( File file ) throws IOException , TranscoderException , ClassNotFoundException { try { Object t = Class . forName ( "org.apache.fop.svg.PDFTranscoder" ) . newInstance ( ) ; transcode ( file , ( Transcoder ) t ) ; } catch ( InstantiationException | IllegalAccessException e ) { throw new ClassNotFoundException ( "Could not instantiate PDF transcoder - is Apache FOP installed?" , e ) ; } }
Transcode file to PDF .