PdfWriter.getInstance problem

  • Nobody/Anonymous

    The application runs properly on my computer, but on remote server it throws error message
    The type initializer for "com.lowagie.text.pdf.PdfWriter" threw an exception.
       at com.lowagie.text.pdf.PdfWriter.getInstance(Document document, Stream os)

    • Nobody/Anonymous


      My problem is so similar, i have problems with the sentence :
      PdfWriter.getInstance(document, new FileOutputStream("filename.pdf"));

      I download itext-1.4.5.jar and the path its correct, but when i runs the program thrwos and exception:
      Exception in thread main
      java.lang.NoClassDefFoundError: com.lowagie.text.pdf.PdfGraphics2D
          at com.lowagie.text.pdf.PdfWriter.<init>(PdfWriter.java:844)
          at com.lowagie.text.pdf.PdfWriter.getInstance(PdfWriter.java:864)
          at proves.Images.main(Images.java:22).

      The code of my program is ridiculus:

                   try {
                     PdfWriter.getInstance(document, new FileOutputStream("filename.pdf"));
                     document.add(new Paragraph("Hi, this is your PDF file!"));

      I'm using jDeveloper. Have someone help me please?

      Thank you

      • Kazuya Ujihara

        Kazuya Ujihara - 2006-10-07

        This site is for .NET Framework. You have to post it at http://www.lowagie.com/iText/ .

        • Nobody/Anonymous


          I am getting the same problem. It works fine in local system, but its throwing error like

          "The type initializer for 'com.lowagie.text.pdf.PdfWriter' threw an exception."

          when i tried to run at online server.

          I am using shared hosting, so I really dont know whether J# distribution is installed or not?

          Please help me,as project deadline on head.


          • Nobody/Anonymous

            You have to install J# redistributable on the server, not on client.

    • Kazuya Ujihara

      Kazuya Ujihara - 2006-10-07

      Did you install Visual J# runtime package on the web server?


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks