Description
[imported from SourceForge]
http://sourceforge.net/tracker/index.php?group_id=78314&atid=552832&aid=1182270
Originally submitted by nobody on 2005-04-13 07:51.
Hi, at last I understand what is wrong with
org.pdfbox.examples.fdf.setField example - my file is
encripted but there wasn't code for decryption please
add it there for the other developers.
Ilya
private void setField( String[] args ) throws
IOException, COSVisitorException
{
PDDocument pdf = null;
try
{
if( args.length != 3 )
else
{
SetField example = new SetField();
pdf = PDDocument.load( args[0] );
PrintFields exporter = new PrintFields();
if( pdf.isEncrypted() )
{
try
catch ( CryptographyException e )
{ System.err.println( "Error: The document is encrypted." ); usage(); }catch( InvalidPasswordException e )
{ System.err.println( "Error: The document is encrypted." ); usage(); } }
example.setField( pdf, args[1], args[2] );
pdf.save( args[0] );
}
}
finally
{
if( pdf != null )
}
}