You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Timo Rumland <ti...@digitalys.de> on 2016/04/27 09:17:59 UTC

Migrating from 1.8.2 to 2.0.0: PDUnknownField removed?

Hello,

I'm currently migrating from PDFBox 1.8.2 to 2.0.0. In the former version, I
used the following code to check for the existence of a PDF form field:


----

PDField pdField = pdAcroForm.getField( pdFieldName );

if ( pdField == null || ( pdField instanceof PDUnknownField ) )
	throw new RuntimeException( "Failed to fill PDF field: Given field
'" + pdFieldName + "' is unknown" );

----


After migrating to PDFBox 2.0.0, the class "PDUnknownField" is no longer
available.

I can't find information about "PDUnknownField" the migration guide
(https://pdfbox.apache.org/2.0/migration.html).


Has the class been removed without any replacement, so I just check for
"pdField == null" in my example above, or is there a replacement for
"PDUnknownField" I may have missed?


Thanks a lot for your help!


Kind regards,
Timo Rumland


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


Re: Migrating from 1.8.2 to 2.0.0: PDUnknownField removed?

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi,
> Am 27.04.2016 um 11:28 schrieb Timo Rumland <ti...@digitalys.de>:
> 
> Hi Maruan,
> 
>> yes, the class has been removed. I'll update the Migration Guide. The test
> for null should be sufficient.

the Migration Guide has been updated. Thanks for the hint.

BR
Maruan

> 
> thanks a lot for your quick response!
> 
> 
> 
> Best Regards,
> Timo
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Maruan Sahyoun [mailto:sahyoun@fileaffairs.de] 
> Gesendet: Mittwoch, 27. April 2016 10:31
> An: users@pdfbox.apache.org
> Betreff: Re: Migrating from 1.8.2 to 2.0.0: PDUnknownField removed?
> 
> Hi,
> 
>> Am 27.04.2016 um 09:17 schrieb Timo Rumland <ti...@digitalys.de>:
>> 
>> Hello,
>> 
>> I'm currently migrating from PDFBox 1.8.2 to 2.0.0. In the former 
>> version, I used the following code to check for the existence of a PDF
> form field:
>> 
>> 
>> ----
>> 
>> PDField pdField = pdAcroForm.getField( pdFieldName );
>> 
>> if ( pdField == null || ( pdField instanceof PDUnknownField ) )
>> 	throw new RuntimeException( "Failed to fill PDF field: Given field
> '" 
>> + pdFieldName + "' is unknown" );
>> 
>> ----
>> 
>> 
>> After migrating to PDFBox 2.0.0, the class "PDUnknownField" is no 
>> longer available.
>> 
>> I can't find information about "PDUnknownField" the migration guide 
>> (https://pdfbox.apache.org/2.0/migration.html).
>> 
>> 
>> Has the class been removed without any replacement, so I just check 
>> for "pdField == null" in my example above, or is there a replacement 
>> for "PDUnknownField" I may have missed?
> 
> yes, the class has been removed. I'll update the Migration Guide. The test
> for null should be sufficient.
> 
> BR
> Maruan
> 
> 
> 
>> 
>> 
>> Thanks a lot for your help!
>> 
>> 
>> Kind regards,
>> Timo Rumland
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
> 


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


AW: Migrating from 1.8.2 to 2.0.0: PDUnknownField removed?

Posted by Timo Rumland <ti...@digitalys.de>.
Hi Maruan,

> yes, the class has been removed. I'll update the Migration Guide. The test
for null should be sufficient.

thanks a lot for your quick response!



Best Regards,
Timo


-----Ursprüngliche Nachricht-----
Von: Maruan Sahyoun [mailto:sahyoun@fileaffairs.de] 
Gesendet: Mittwoch, 27. April 2016 10:31
An: users@pdfbox.apache.org
Betreff: Re: Migrating from 1.8.2 to 2.0.0: PDUnknownField removed?

Hi,

> Am 27.04.2016 um 09:17 schrieb Timo Rumland <ti...@digitalys.de>:
> 
> Hello,
> 
> I'm currently migrating from PDFBox 1.8.2 to 2.0.0. In the former 
> version, I used the following code to check for the existence of a PDF
form field:
> 
> 
> ----
> 
> PDField pdField = pdAcroForm.getField( pdFieldName );
> 
> if ( pdField == null || ( pdField instanceof PDUnknownField ) )
> 	throw new RuntimeException( "Failed to fill PDF field: Given field
'" 
> + pdFieldName + "' is unknown" );
> 
> ----
> 
> 
> After migrating to PDFBox 2.0.0, the class "PDUnknownField" is no 
> longer available.
> 
> I can't find information about "PDUnknownField" the migration guide 
> (https://pdfbox.apache.org/2.0/migration.html).
> 
> 
> Has the class been removed without any replacement, so I just check 
> for "pdField == null" in my example above, or is there a replacement 
> for "PDUnknownField" I may have missed?

yes, the class has been removed. I'll update the Migration Guide. The test
for null should be sufficient.

BR
Maruan



> 
> 
> Thanks a lot for your help!
> 
> 
> Kind regards,
> Timo Rumland
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
> 


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



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


Re: Migrating from 1.8.2 to 2.0.0: PDUnknownField removed?

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi,

> Am 27.04.2016 um 09:17 schrieb Timo Rumland <ti...@digitalys.de>:
> 
> Hello,
> 
> I'm currently migrating from PDFBox 1.8.2 to 2.0.0. In the former version, I
> used the following code to check for the existence of a PDF form field:
> 
> 
> ----
> 
> PDField pdField = pdAcroForm.getField( pdFieldName );
> 
> if ( pdField == null || ( pdField instanceof PDUnknownField ) )
> 	throw new RuntimeException( "Failed to fill PDF field: Given field
> '" + pdFieldName + "' is unknown" );
> 
> ----
> 
> 
> After migrating to PDFBox 2.0.0, the class "PDUnknownField" is no longer
> available.
> 
> I can't find information about "PDUnknownField" the migration guide
> (https://pdfbox.apache.org/2.0/migration.html).
> 
> 
> Has the class been removed without any replacement, so I just check for
> "pdField == null" in my example above, or is there a replacement for
> "PDUnknownField" I may have missed?

yes, the class has been removed. I'll update the Migration Guide. The test for null should be sufficient.

BR
Maruan



> 
> 
> Thanks a lot for your help!
> 
> 
> Kind regards,
> Timo Rumland
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
> 


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