Skip to Content
0
Mar 03, 2009 at 08:17 AM

PDF upload from file and extracting data

131 Views

Hi,

I am trying to upload a pdf form (created with the SAP ABAP Formbuilder) to ABAP and extract the data. Although I found some SDN articles on that, I get error messages when following the instructions. I include an upload file element in the WD application and bind the data to an XSTRING variable. Then the pdf should be uploaded and the data extracted. However, it fails when the first call to the ADS is issued.

Here is my code in an ABAP Web Dynpro application which is copied from another SDN contribution:

-


DATA CONTENT TYPE XSTRING.

*Get the cotent from the file

WD_CONTEXT->GET_ATTRIBUTE( EXPORTING NAME = 'PDF' IMPORTING VALUE = CONTENT ).

*Get a reference to the form processing class.

DATA: L_FP TYPE REF TO IF_FP.

L_FP = CL_FP=>GET_REFERENCE( ).

*Get a reference to the PDF Object class.

DATA: L_PDFOBJ TYPE REF TO IF_FP_PDF_OBJECT.

L_PDFOBJ = L_FP->CREATE_PDF_OBJECT( ).

*Set the pdf in the PDF Object.

L_PDFOBJ->SET_DOCUMENT( PDFDATA = CONTENT ).

*Set the PDF Object to extract data the Form data.

L_PDFOBJ->SET_EXTRACTDATA( ).

*Execute call to ADS

L_PDFOBJ->EXECUTE( ).

-


With calling the EXECUTE statement I get an error message:

"ADS: com.adobe.ProcessingException: Error exporting Data into PDF - PDF Exception: Invalid object for the XFA entry in the forms dictionary.(200201).

"

Can anybody help ?

Thanks

Marcus