[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fop-user
Subject:    Re: Email
From:       Mukku Sarath Kiran <mukkusarath () gmail ! com>
Date:       2007-03-27 9:33:30
Message-ID: loom.20070327T112104-285 () post ! gmane ! org
[Download RAW message or body]


liam grimes <liamgrimes <at> gmail.com> writes:

> 
> Hi all have anyone tried to render the fo stream to pdf and email it to an 
recipient.?? Is it possible in java.. if so can you please help.Thanx


Hi,

 render fo stream to pdf : download fop 0.93 , see there is example   
                           ExampleFO2PDF.java. you can get an idea.


 for emailing pdf, you can write program like

     javax.mail.Session mailSession   = javax.mail.Session.getDefaultInstance( 
                                                  properties, null );
            Multipart  mep            = new MimeMultipart();
            MimeBodyPart mebp1          = new MimeBodyPart();
            MimeBodyPart mebp2          = new MimeBodyPart();
            
            message = new MimeMessage( mailSession );
            message.setFrom( );
            message.setRecipients( );
            
            try {                    
                    if (Attachment!=null) {
                        FileDataSource fds = new FileDataSource( Attachment );
                        mebp2.setDataHandler( new DataHandler( fds ));
                        mebp2.setFileName( fds.getName() );
                    }
                }
               
            mebp1.setText( );                
            mep.addBodyPart( mebp1 );            
            mep.addBodyPart( mebp2 );

            // add the Multipart to the message
            message.setContent( mep );
                                                
            Transport.send( message, addrRecipient );

  sarath




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic