cancel
Showing results for 
Search instead for 
Did you mean: 

HowTo extract data form uploaded PDF-Object

J_B
Explorer
0 Kudos

i have an uploaded PDF and want to extract the data of this Object to make an rfc-call and update the date at a backend system.

I have looked through the Help-files (api) and found the Interface IWDPDFObject, but in my DevStudio Vers. 2.0.6 i cant find the classes.

So, at the moment i don't know how to read the fields out of a PDF-Object (the node) and fill my update structure.

Thanks for help !

Regards

Jürgen

Accepted Solutions (0)

Answers (1)

Answers (1)

StefanBeck
Advisor
Advisor
0 Kudos

Hello Jürgen,

you will receive that data XML from the PDF with:

IWDPDFObject pdfObject = WDPDFObjectFactory.getPDFObject();

pdfObject.setPDF(pdfDocument);

InputStream data = pdfObject.getData();

Then it is up to you to parse it and to move data into your data structure.

If the Web Dynpro context fits to the data structure of your PDF, you can use the InteractiveForm with mode "usePDF" and display the PDF online. In that case, the update of Web Dynpro context happens automatically.

Regards

Stefan

J_B
Explorer
0 Kudos

Hy Stefan,

i'am on the search to find my error. So i had some debug-statements build in (printout's) at the upload-Methode.

I had a view with a integrated PDF. There is a PDF shown. At the beginning (initialize) all interactive from attibutes have the status updateDataInPDF. After the button upload pressed, the interactive from attibute (the document) his switched to the modus usePDF.

DEBUG ... PDF has mode = USEPDF !!

Then i print out all my node - Structures and the current nodeElement and the current Context Element. All these structures have the old values, but the displayed uploaded PDF

has the new values.

Now my question. How can i get the actual values of my PDF (the structure) ?

My problem is, that i must copy the acutal values ot the structure to the RFC - update structure to recalculate some values and display them on a new PDF.

Thanks for help !

By Jürgen

StefanBeck
Advisor
Advisor
0 Kudos

Hallo Ju00FCrgen,

it seems, that you have to patch your IDE to get the APIs:

find the jar under a patch like C:\usr\sap\J2E\JC00\j2ee\cluster\server0\bin\services\webdynpro\webdynprolib\_webdynpro_pdfobject.jar and copy it to your IDE into C:\Program Files\SAP\JDT\eclipse\plugins\com.sap.tc.webdynpro.runtime\lib.

Your paths maybe a little bit different dependent of your installation. With a later IDE version, this is not necessary.

Most likely the PDF does not update the context automatically because it was not changed after the uploaded. In this case, the document would not be sent. Can you double check whether I'm right by changing a value before submit? If that helps, stack 10 will contain a fix. If not, please post in SDN again and we will see.

Regards

Stefan