Suggestions on a Java PDF API?

I need some help finding a suitable PDF API for Java. My web application is comprised of a Java Servlet and a Java ServerPages.
The JSP generates a HTML output which I need to create a PDF from.
I have seen some on iText, but it seems limited and lacking the full PDF spesification, and only seens to support PDF version 1.4
It seems like the really good Java PDF API's cost plenty of money. What I need is an not nescesary Open Source, but free. But Open Source would be nice.

i-Text is an open source programmatic PDF generator. You can also use XSL-FO to render a PDF (download FOP from Apache). Adobe recently open sourced the PDF format, so there are probably even more offerings out now than those.
- Saish

Similar Messages

  • Performance issue with Business Objects Java JRC API in CRXI R2 version

    A report is developed using java JRC API in CR XI release 2. When I generate the report in the designer, it took less than 5 seconds to display the results in crystal report viewer inside the designer. But in the QA environment, when I generate the same report from the application, it takes almost 1 to 1.5 minutes to display the same results in PDF. I also noticed that if the dataset contains bigger volume of data, then the reports are taking even longer almost 15 to 20 minutes.
    While generating the report from the application, I noticed that most of time is taken during the execution of the com.crystaldecisions.report.web.viewer.ReportExportControl Object method as shown in following line of code
    exportControl.processHttpRequest(request, response, context, null)
    We thought the delay in exporting the report to PDF might be the layout of the report and data conversion to PDF for such a bigger volume of data.
    Then we investigated the issue and experimented quickly to generate the same report with same result set data from the application using XML, XSL and converted the output XSL-FO to PDF using Apache FOP (Formatting Objects Processor) implementation. The time taken to export the report to PDF is less than 6 seconds. By doing this experiment, it is proved that the issue is not with conversion of data to PDF but it is the performance problem with Business Objects Java JRC API in CR XI R2.
    In this regard, I searched for the above issue in the SAP community Network Forums -> Crystal Reports and Xcelsius -> Java Development -> Crystal Reports. But I did not find any answers or solutions for this kind of issue in the forums.
    Any suggestion, hint in this matter is very much appreciated.

    Ted, The setReportAppServer problem is resolved. Now I could able to generate the report with hardcoded values in the SQLs in just 6 seconds where as the same report was generated in CRXI R2 in 1 minute 15 seconds as mentioned in the earlier message.
    But, our exisiting application passes the parameter values to the SQLs embedded in the report. For some reason the parameters are not being passed to the report and the report displays only the labels without data.
    As per the crj 12 samples codes, the code is written as shown below.
    1. Created ReportClient Document
    2. SetReportAppServer
    3. Open the report
    4. Getting DatabaseController and switching the database connection at runtime
    5. Then setting the parameters as detailed below
    ParameteFields parameterFieldController = reportClientDoc.getDataDefController().getParameterFieldController();
    parameterFieldController.setCurrentValue("", "paramname",paramvalue);
    parameterFieldController.setCurrentValue("", "paramname",paramavalue);
    byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF); 
    6. Streaming the report to the browser
    Why the parematers are not being passed to the report?  Do I need to follow the order of setting these parameters?  Did I miss any line of code for setting Params using  crj 12?
    Any help in this regard would be greatly appreciated.

  • Read Attachments using Java Mapping API

    Hello,
    after investigating the Java Mapping API a little deeper I found some very interesting Interfaces "InputAttachments" and "Attachments" which could do exactly what is required:
    Reading attachments and convert them into base64 code.
    As I am not an experienced Java Programmer howeve, I am note sure how to use those interfaces.
    For example there is a method defined in interface "InputAttachments":
    Attachment getAttachment(String contentID)
    How do I use it? If I use it in a way like "InputAttachments.getAttachment("abc");" then I get the error that it is not a static method. However how do I instantiate "InputAttachments".? As it is an interface I am not sure how to do this.
    Any idea how to handle these methods?

    Hi,
    I am working on the similar. I am able to attach txt files and csv files but have trouble attaching xcel and pdf's. Any input is appreciated. Thanks

  • Issue with JAVA Mail API

    Hi
    We have a requirement to create a custom e mail. For the same I am trying to use Java Mail API.I am facing an issue with the following code:
    session session1 = session.getInstance(properties, null);
    System gives an error Sourced file: inline evaluation of: ``Properties props = new Properties(); session session1 = session.getInstance(prop . . . '' : Typed variable declaration : Class: session not found in namespace
    Is there some specific API i need to import for session class. Kindly suggest.
    Regards
    Shobha

    Hi Shobha,
    I was also facing the same issue from last couple of weeks and just now i have achieved the working functionality.
    Please find below working code and replace values as per your serveru2019s configuration.
    import com.sap.odp.api.util.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    import java.io.File;
    import java.net.*;
    // SUBSTITUTE YOUR EMAIL ADDRESSES HERE!!!
    String to =<email address>;
    String from =<email address>;
    // SUBSTITUTE YOUR ISP'S MAIL SERVER HERE!!!
    String host = <smtp host name>;
    String user = <smtp user name>;
    // Create properties, get Session
    // Properties props = new Properties();
    Properties props = System.getProperties();
    props.put("mail.transport.protocol", "smtp");
    props.put("mail.smtp.host", host);
    props.put("mail.debug", "false");
    props.put("mail.smtp.auth", "false");
    props.put("mail.user",user);
    props.put("mail.from",from);
    Session d_session = Session.getInstance(props,null);//Authenticator object need to be set
    Message msg = new MimeMessage(d_session);
    msg.setFrom(new InternetAddress(from));
    InternetAddress[] address = {new InternetAddress(to)};
    msg.setRecipients(Message.RecipientType.TO, address);
    msg.setSubject("Test E-Mail through Java");
    msg.setSentDate(new Date());
    msg.setText("This is a test of sending a " +
    "plain text e-mail through Java.\n" +
    "Here is line 2.");
    Transport.send(msg);
    Deepak!!!

  • How to start with Java TV API?

    Hi,
    I am new to Java TV API and i don't know how to start with it. Can any body suggest me what i would require(Software and hardware) to start coding in Java TV. Is MHP API are required for it if yes then how i can get those APIs??
    Thanks in advance
    Sajal Mahajan
    [email protected]
    Message was edited by:
    Sajal.Mahajan

    OCAP 1.0 and 1.1 specifications are avaible here:
    http://opencable.com/specifications/ocap.html
    tutorials:
    http://interactivetvweb.org
    Emulator:
    http://xletview.sourceforge.net/

  • Oracle Java Mail API exception in Jdev 11.1.15

    we are using java mail api to send out emails. and wrap it in java embedding with in our webservice.
    we are using jdeveloper 11.1.1.5 for this and the Java API is failing with the below error, we have included all the java libraries. As code is working fine in Jdeveloper 11.1.2
    we tried different version of jdeveloper ( 11.1.1.5, 11.1.1.7 ) but its still the same. Can some one please suggest
    Exception in thread "main" java.lang.RuntimeException: javax.mail.MessagingException: Can't send command to SMTP host;
      nested exception is:
        javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at bts.mail.SendMailTLS.main(SendMailTLS.java:50)
    Caused by: javax.mail.MessagingException: Can't send command to SMTP host;
      nested exception is:
        javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1420)
        at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1408)
        at com.sun.mail.smtp.SMTPTransport.ehlo(SMTPTransport.java:847)
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:384)
        at javax.mail.Service.connect(Service.java:297)
        at javax.mail.Service.connect(Service.java:156)
        at javax.mail.Service.connect(Service.java:105)
        at javax.mail.Transport.send0(Transport.java:168)
        at javax.mail.Transport.send(Transport.java:98)
        at bts.mail.SendMailTLS.main(SendMailTLS.java:45)

    Can Some body help me with this please

  • Java mail api: SendFailedException when trying to send Mail via SMTP

    Hello,
    I'm trying to send a mail via java mail api using a server that requires smtp authentication.
    I'm currently using the following code:
    protocol = "smtp";
    host = "auth.smtp.profimailer.de";
    port = 25;
    String from="[email protected]";
    String to="[email protected]";
    props.put("mail.smtp.host", host);
    props.put("mail.smtp.auth", "true");
    Authenticator auth = new PopupAuthenticator();
    session=Session.getInstance(props,auth);
    MimeMessage message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from,"[email protected]"));
    message.addRecipient(Message.RecipientType.TO,new InternetAddress(to,"ToName"));
    message.setSubject("Hello JavaMail");
    message.setText("Welcome to JavaMail");
    Transport.send(message);
    static class PopupAuthenticator extends Authenticator {
            public PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication("e12345676", "mypass");
    }When trying to run this code, I get the following exception:
    D:\eclipse30RC1\workspace\ClassifyIt\bin>java -cp .;../lib/javamail.jar de.jwannenmacher.classify.TestMail > test.txt
    javax.mail.SendFailedException: Send failed;
    nested exception is:
    javax.mail.SendFailedException: Sender "[email protected]" <jens
    @jens-wannenmacher.de> was rejected: 501
    at javax.mail.Transport.doSend(Transport.java:223)
    at javax.mail.Transport.send(Transport.java:92)
    at de.jwannenmacher.mail.pop3client.POP3Client.getAllNewMessages(POP3Cli
    ent.java:176)
    at de.jwannenmacher.classify.TestMail.main(TestMail.java:22)
    Any suggestions on this?
    Thanks and best regards,
    Jens

    Hi,
    yes smtp is a standard and I think you could use this with almost every smtp server.
    If your smtp server doesn't require authentication you can access it without an authenticator
    I think...
    Best regards,
    Jens

  • String "iso-8859-1" found in subject line of java mail API(when German char

    We have written a mail client using java mail API and it works fine. Some body sends the email with subject line contains German chars(using some other mail client like outlook)
    and our mail client is running on the machine whose Local has been set 'German'.
    Now, while getting the subject line
    Javax.mail.Message email; //local variable
    // some how I am intializing email.
    String str = email.getSubject();
    the value of str returns "Bitte die 4 Items I�schen. Kein Bedarf. Ich kann die=?iso-8859-1?Q?_L=F6schung_nic?="
    but actual value subject line was "Bitte die 4 Items I�schen. Kein Bedarf. Ich kann die L�schung nic"
    So '�' char was repalced by some arbit chars.
    Moreover, Charset.defaultCharset().name() returns 'windows-1252'
    Please suggest me how I can get the actual subject line
    Thanks
    -Sanjeev

    http://forum.java.sun.com/thread.jspa?threadID=741111&messageID=4250621
    visit it
    by ghanshyam

  • Newbie question on the Java communications API

    Hi All,
    I found the javax.comm extension package that lets me listen to the serial port of the PC, but am unsure as to how to use it. Well, I've tried running the SimpleRead.java program and I get an error message that says the package is missing in the import (which I assume means that I havent downloaded it and added it to one of the folders in my Java directory). Where can I find the package from? And am I missing anything else?
    In case you're all wondering, I've got a microcontroller attached to the serial port that sends data periodically. I would like to use the Java comm API to read the incoming data (and if possible store it in the form of a text file or something). Any suggestions would be great as I'm still new to Java. More of a C/C++ person (^_^) Thanks in advance.....

    Did you try using that little search field in the upper right hand corner of your browser?

  • Java PDF services without Livecycle server

    I use the Java client API, no workbench processes. All PDF operations, like assembly, reader extensions, form data integration and extraction, require a running Livecycle server.
    Is there any option to add a Java jar to my project with the service implementations and as such excluding the Livecycle server?
    Direct method calls, no EJB or REST would be perfect.

    You will still need Livecycle server

  • Using Java mail API from JSPDynPage

    Hi Experts,
    I am working on a Portal Assignment that requiresto sent work flow mails on the basis of error conditions.
    Can u please suggest if at all I can use Java Mail APIs from JSP page within the JSP DYN Page Framework.
    If at all Java Mail can be used could u please suugest some help docs on the same.
    Thanks for the help.
    Manab C Ghosh
    EP Consultant
    Kolkata INDIA
    +919830603327

    Hi Experts,
    Thanks for all the responses to my Mail question(mailing from JSPDynPage).
    I have found the solution.
    Here is how I have got the things: (pls note there are other solns)
    Using Java Mail APIs;
    Create a Java file in the scr.core / src.api
    MailSender.java
    * Created on Jul 21, 2005
    * To change the template for this generated file go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    package com.mailsend.test;
    import java.util.Date;
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.Multipart;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    * Edited on Jul 24, 2005
    * @author Manab C Ghosh
    public class MailSender {
         public String sendMessage(){
            String msg ="Hello mail Test";
            String smtpServer ="mySMTPServer";
            String smtpSender = "senderemailaddress";
            String smtpRecipient="receipientemailaddress";
            String stBody =  msg ;
            //String stDate = new Date().toString() ;
            String stSubject = "Mail Test ";
            Send(     smtpServer,          //SMTPServer
                      smtpSender,          //Sender
                      smtpRecipient,     //Recipient
                      stSubject,          //Subject
                      stBody               //Body
                        );               //Attachments                    
         return "Mail Success";
    public static void Send(String SMTPServer,
                                  String From,
                                  String To,
                                  String Subject,
                                  String msgText1
            // Error status;
            int ErrorStatus = 0;
            // create some properties and get the default Session
            Properties props = System.getProperties();
            props.put("mail.smtp.host", SMTPServer);
            Session session = Session.getDefaultInstance(props, null);     
            try {
                 // create a message
                 MimeMessage msg = new MimeMessage(session);
                 msg.setFrom(new InternetAddress(From));
                 InternetAddress[] address = {new InternetAddress(To)};
                 msg.setRecipients(Message.RecipientType.TO, address);
                 msg.setSubject(Subject);
                 // create and fill the first message part
                 MimeBodyPart mbp1 = new MimeBodyPart();
                 mbp1.setText(msgText1);
                 // create the Multipart and its parts to it
                 Multipart mp = new MimeMultipart();
                 mp.addBodyPart(mbp1);
                 //mp.addBodyPart(mbp2);
                 // add the Multipart to the message
                 msg.setContent(mp);
                 // set the Date: header
                 msg.setSentDate(new Date());
                 // send the message
                 Transport.send(msg);
            } catch (MessagingException mex) {
    Call this file from the JSP page (which is set at JSPDynPage controller)
    one important thing-----
    Create a dir under PORTAL-INF and import the following jars-- activation.jar, mail.jar,imap.jar,smtp.jar, mailapi.jar.
    This works..
    Thanks once again to the Experts.
    happy mailing
    Manab Ghosh.
    INDIA (+919830603327)

  • Java 8: Pb with new java.time api

    Hello,
    I'm trying to use the new java.time api that comes with Java 8 (I already know joda-time).
    I'm using the latest build B124.
    I've a String "01/08/2012_00:00:01", I know that the time ref. is UTC, and I want to convert it to an 'Instant';
    I tried:
    DateTimeFormatter FORMAT_DT = DateTimeFormatter.ofPattern("dd/MM/yyyy_HH:mm:ss").withZone(ZoneOffset.UTC);
    Instant instant = Instant.from(FORMAT_DT.parse("01/08/2012_00:00:01"));
    But it fails with following error:
    java.time.DateTimeException: Unable to obtain Instant from TemporalAccessor: {},ISO resolved to 2012-08-01T00:00:01 of type java.time.format.Parsed
         at java.time.Instant.from(Unknown Source)
    I don't understand what's wrong with my code, and I can't figure out how I should proceed to convert the String to an Instant ...
    Any suggestion welcome,
    Best regards,
    Bernard.

    Originally you stated this:
    I don't understand what's wrong with my code,
    So naturally we focused on how to "understand what's wrong' with your code.
    You will never learn to troubleshoot problems if you just throw your hands up in the air and ask for help just because a complex series of steps doesn't complete successfully. 
    Break the process into its individual steps and check the results of each step to identify which step is FIRST producing an error.
    When a complex or multi-step process has an error you start checking the individual steps of the process to see how far it gets successfully.
    I would expect that converting a String to an Instant should be a basic/simple need, so it should be possible to do it in two lines of code; for the time being, the only way I found is to use a LocalDateTime intermediate variable, which seems quite verbose, and I'm wondering if someone knows a better way to do it, and would be willing to share it here.
    Just a technical distinction: your latest example using a LocalDateTime intermediate variable CAN be done in one line of code by just using dot-notation to avoid creating an explicit intermediate variable. But that variable will still be created implicitly behind the scenes.
    Converting a String to an Instant might be considered a basic/simple need but the set of functionality related to dealing with times, dates, calendars, etc is extremely complex. It makes much more sense to develop the requisite functionality in modules.
    Especially when introducing new functionality such as the 'Instant' class are related package elements introduced in 1.8. That functionality builds on what came before and parsers already existing that know how to deal with all of the possible String variants and formatting options and so on.
    Since that work CAN BE done on-the-fly using dot notation and anonymous implicit intermediate classes there isn't much need to reinvent that functionality in the new classes. If certain uses become standard new methods can always be added (e.g. to the Instant class) that will 'appear' to do things in one step.
    And, being an early adopter release, you can always file a 'bug' or enhancement request from the 1.8 download page. That page has links for 'Report Bugs' and 'Feedback forum' that you can use.
    In this current forum no one can give you an 'official' answer as to why something was implemented a particular way and/or whether that implementation is a 'bug' or was designed to work that way. Only Oracle can do that.

  • How to distrubute java communication api ?

    hi , I have a java project using java comm api (comm.jar) I need to distrubute it to clients (because it is an applet based app) without any user interactivity.
    First I remember Webstart but somewhere I read some bugs about comm.api and webstart so I want to ask first Is there any people here used to developed and distrubute comm.api before ? What did you used ?
    My clients has no knowledge about computers,so It should be some automatic process.

    What about my suggestion in your original post regarding the same question?
    http://forum.java.sun.com/thread.jsp?thread=412320&forum=31&message=1814508

  • Doubt handling Clob columns with Java JDBC api

    Hi,
    we have a doubt handling Clob columns with Java JDBC api.
    Reading Oracle 10g official documentation (document b10979.pdf, page 236), we found this note:
    ============================================
    To write LOB data, the application must acquire a write lock on the LOB object. One way to accomplish this is through a SELECT FOR UPDATE. Also, disable auto-commit mode.
    ============================================
    We also found a java sample code about how to handle Lob objects at this URL:
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/LOBSample.java.html
    In our java2 application, we access Clob objects in a quite different
    manner: we use normal setString() and getString() methods, as described into paragraph "Shortcuts For Inserting and Retrieving CLOB Data"
    (document b10979.pdf, page 244).
    Using those methods, we never lock the table row by a SELECT FOR UPDATE statement (as described into the note above). We use simply SELECT, UPDATE and INSERT prepared statement.
    In this way we can insert both clob objects and normal timestamp, number and other types with a single insert statement. Idem for update.
    To recap, our question is:
    Is it mandatory to create a SELECT FOR UPDATE statement when updating clob data? What may be the consequences if we don't use it? It is also correct to insert with a single sql statement both clob and not clob data using the setString() method for the clob types? And more than one lob column in the same record?
    bye,
    luca acri.

    And columns of type FLOAT. These also have, for some unknown reason a metadata type of OTHER, and a type string of 'FLOAT'. Yet PreparedStatement.setNull(x, Types.OTHER) doesn't work and setNull(x, Types.DECIMAL) does.

  • I want Java TV API basic programming exmples

    Hi ,
    I'm new to Java TV API. can any one please give me the details how to write the program and run application.
    and give the runtime environment with other configuration details.Any sample applications and links.
    any suggestion is appreciated.
    Thanks & Regards,
    Prasad.P

    Take a look at http://www.interactivetvweb.org http://www.mhp-knowledgebase.org/ and http://www.mhp.org/
    You'll find what you need to start.

Maybe you are looking for