This may be a stupid post, but as a relative java newbie I'm really stuck
here.

I'm developing integration for pdf forms into our companies reporting
architecture, and I'm trying to test using iText to see if it will meet our
requirement.

I've created the following java program:

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.io.InputStream;

import com.itextpdf.text.DocumentException;
import com.itextpdf.text.pdf.AcroFields;
import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.PdfStamper;
import com.itextpdf.text.pdf.FdfReader;
import com.itextpdf.text.pdf.PdfEncryption;

import org.bouncycastle.jce.provider.BouncyCastleProvider;

public class ImportFDF {
public static void main (String[] args) {
try
{
String in_pdf = args[0];
String in_fdf = args[1];
String out_pdf = args[2];
PdfReader reader = new PdfReader(in_pdf);
PdfStamper stamp = new PdfStamper(reader, new 
FileOutputStream(out_pdf));
FdfReader fdf = new FdfReader(in_fdf);
AcroFields form = stamp.getAcroFields();
form.setFields(fdf);
stamp.setFormFlattening(true);
stamp.close();
} 
catch (Throwable t)
{
   t.printStackTrace();
}
}
}


I'm able to compile this fine using the command below (all jars are in the
same directory from which I'm executing the command):

javac -cp ".;iText-5.0.6.jar;bcmail-jdk16-146.jar;bcprov-jdk16-146.jar"
ImportFDF.java


But when I run the following command (again all files in same directory) I
get the error below:

java -cp .;iText-5.0.6.jar;bcmail-jdk16-146.jar;bcprov16-146.jar ImportFDF
input.pdf input.fdf x.pdf

java.lang.NoClassDefFoundError: org/bouncycastle/asn1/ASN1OctetString
        at com.itextpdf.text.pdf.PdfEncryption.(PdfEncryption.java:138)
        at
com.itextpdf.text.pdf.PdfReader.readDecryptedDocObj(PdfReader.java:76
3)
        at com.itextpdf.text.pdf.PdfReader.readDocObj(PdfReader.java:1134)
        at com.itextpdf.text.pdf.PdfReader.readPdf(PdfReader.java:512)
        at com.itextpdf.text.pdf.PdfReader.(PdfReader.java:172)
        at com.itextpdf.text.pdf.PdfReader.(PdfReader.java:161)
        at ImportFDF.main(ImportFDF.java:23)
Caused by: java.lang.ClassNotFoundException:
org.bouncycastle.asn1.ASN1OctetStri
ng
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 7 more

This is all using Java 16 

Help!!!

Thanks
Andy

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/java-lang-NoClassDefFoundError-org-bouncycastle-asn1-ASN1OctetString-tp3427288p3427288.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to