cancel
Showing results for 
Search instead for 
Did you mean: 

how can user attach file to interactive form, and be read by abap program?

Sandra_Rossi
Active Contributor
0 Kudos

Hello,

I created an abap interactive form, sent to the user, then user fills out the form fields, then it is uploaded back to sap, then my program reads this data and process it.

It works.

Now I want users to be able to attach any file they want, and the abap program to extract this file out of the PDF, to put it into SAP (or anywhere).

I succeeded in attaching a file, I can "see" it via function module get_annotations, but I get the file in compressed form by Adobe (filter="FlateDecode").

Do you know how to unzip the file?

Is there another way to attach files in adobe reader?

I use acrobat reader 8.1.2

Thx a lot!

sandra

Below is the xml obtained by GET_ANNOTATIONS. We see that there are other text annotations, and that the attached file has {length="98005"}, though real file (before "attach file" to the PDF, and also after "detach file") has length 111 995 bytes. It's why I deduced that there is a compression (I also tried to extract it as-is and open it with adobe but it doesn't work.

<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
  <annots>

    <highlight rect="212.347,624.257996,252.979004,636.539978" creationdate="D:20080604100938+02'00'"
 name="2114308b-275d-4eca-8bfc-c8288ef4a77c" color="#FFFF00" flags="print"
 date="D:20080604100938+02'00'" title="mtresori" subject="Texte surligne "
 coords="215.432999,636.179016,249.893005,636.179016,215.432999,624.619019,249.893005,624.619019"
 page="0">
      <popup rect="595.276001,516.179016,775.276001,636.179016" flags="print,nozoom,norotate"
 open="no" page="0"></popup>
    </highlight>

    <fileattachment rect="15.345001,802.841003,29.345001,822.841003"
 creationdate="D:20080604101011+02'00'" name="f6e12648-c9b0-4cd1-b08b-82876c8300d7"
 color="#4055FF" flags="print,nozoom,norotate" date="D:20080604101019+02'00'" title="mtresori"
 subject="Piece jointe" file="SAP_WIDGETS2.pdf" mimetype="application/pdf"
 creation="D:20080603112937+02'00'" modification="D:20080603112937+02'00'" size="111995"
 checksum="9F846412B510089F7C6DBCC6527C6339" page="0">
      <contents-richtext>
        <body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
 xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.0.2">
          <p>SAP_WIDGETS2.pdf</p>
        </body>
      </contents-richtext>
      <data MODE="raw" encoding="hex" length="98005" filter="FlateDecode">
4889CC570B5414D719F651A38EC468D5C6A2980104E528BBF3B8F3B2626405242920020A0AA4AEBB
C3B2BAECEAEEA2A018030A628C8FFA4A0F568F58426A1EF5118FB5266A8D9AA2B16A55044541C5
A62656EBA315935AE8BDB3BBEC2C0BD9D5B39EB3671966FEFBFCE6BF
ETC. (all hexa code is the attached file, but with compression by adobe)
      </data>
    </fileattachment>

    <text rect="96.187408,680.099976,116.186996,698.099976" creationdate="D:20080613144537+02'00'"
 name="73360fcf-f5e5-4d5b-9315-fe4c42924300" color="#FFFF00" flags="print,nozoom,norotate"
 date="D:20080613144617+02'00'" icon="Comment" title="srossi" subject="Note" page="0">
      <contents-richtext>
        <body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
 xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.0.2">
          <p dir="ltr">
            <span dir="ltr" 
 style="font-size:10.0pt;text-align:left;color:#000000;
font-weight:normal;font-style:normal">
ffffffffffffffffffffff&#xD;
            </span>
          </p>
        </body>
      </contents-richtext>
      <popup rect="595.276001,578.099976,775.276001,698.099976" flags="print,nozoom,norotate"
 open="yes" page="0"></popup>
    </text>

    <text rect="100,82,120,100" creationdate="D:20080613144627+02'00'" state="Marked"
 name="d524b7d5-1a85-4b62-80b3-5875dd152c51" 
 color="#FFFF00" flags="hidden,print,nozoom,norotate" date="D:20080613144627+02'00'"
 icon="Comment" title="srossi" subject="Note"
 inreplyto="73360fcf-f5e5-4d5b-9315-fe4c42924300" statemodel="Marked" page="0">
      <contents-richtext>
        <body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
 xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.0.2">
          <p>Marked definie par srossi</p>
        </body>
      </contents-richtext>
      <popuprect="595.276001,-20,775.276001,100" flags="print,nozoom,norotate" open="no" page="0"></popuprect="595.276001,-20,775.276001,100">
    </text>

    <text rect="100,82,120,100" creationdate="D:20080613144633+02'00'" state="Accepted"
 name="88af2cb6-7516-4f21-81e6-97edc7a85184"
 color="#FFFF00" flags="hidden,print,nozoom,norotate" date="D:20080613144633+02'00'" icon="Comment"
 title="srossi" subject="Note" inreplyto="d524b7d5-1a85-4b62-80b3-5875dd152c51" statemodel="Review"
 page="0">
      <contents-richtext>
        <body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
 xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.0.2">
          <p>Accepted definie par srossi</p>
        </body>
      </contents-richtext>
      <popup rect="595.276001,-20,775.276001,100" flags="print,nozoom,norotate" open="no" page="0"></popup>
    </text>

    <text rect="100,82,120,100" creationdate="D:20080613144642+02'00'" state="Marked"
 name="a8c6b485-c3f9-44e2-ad53-c61b2766d9d5" color="#FFFF00" flags="hidden,print,nozoom,norotate"
 date="D:20080613144642+02'00'" icon="Comment" title="srossi" subject="Note"
 inreplyto="f6e12648-c9b0-4cd1-b08b-82876c8300d7" statemodel="Marked" page="0">
      <contents-richtext>
        <body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
 xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.0.2">
          <p>Marked definie par srossi</p>
        </body>
      </contents-richtext>
      <popup rect="595.276001,-20,775.276001,100" flags="print,nozoom,norotate" open="no" page="0"></popup>
    </text>

    <text rect="100,82,120,100" creationdate="D:20080613144647+02'00'" state="Accepted"
 name="0136b689-575c-46b8-a21a-86e3c8d73904" color="#FFFF00" flags="hidden,print,nozoom,norotate"
 date="D:20080613144647+02'00'" icon="Comment" title="srossi" subject="Note"
 inreplyto="a8c6b485-c3f9-44e2-ad53-c61b2766d9d5" statemodel="Review" page="0">
      <contents-richtext>
        <body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
 xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.0.2">
          <p>Accepted definie par srossi</p>
        </body>
      </contents-richtext>
      <popup rect="595.276001,-20,775.276001,100" flags="print,nozoom,norotate" open="no" page="0"></popup>
    </text>

    <text rect="100,82,120,100" creationdate="D:20080613144657+02'00'" state="Accepted"
 name="a21fc3c5-cf6a-4c6f-bc1f-328a91050b4e" color="#FFFF00" flags="hidden,print,nozoom,norotate"
 date="D:20080613144657+02'00'" icon="Comment" title="srossi" subject="Note"
 inreplyto="2114308b-275d-4eca-8bfc-c8288ef4a77c" statemodel="Review" page="0">
      <contents-richtext>
        <body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
 xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.0.2">
          <p>Accepted definie par srossi</p>
        </body>
      </contents-richtext>
      <popup rect="595.276001,-20,775.276001,100" flags="print,nozoom,norotate" open="no" page="0"></popup>
    </text>
  </annots>
  <f href="acTempF-00000028453-00000000089"></f>
  <ids original="03473EFED11DB2110A00000000000000" modified="959796E85292D54DB7FA558CAAD4A346"></ids>
</xfdf>

Accepted Solutions (0)

Answers (2)

Answers (2)

Sandra_Rossi
Active Contributor
0 Kudos

Didn't find the solution, but this thread is duplicate. Please look at [the one in abap general|;

Sandra_Rossi
Active Contributor
0 Kudos

Hello everybody,

I am sure you have an answer to my question above. It was :

how is it possible for a user to ATTACH files to a PDF interactive form, and then be able to READ them via a program ? (I guess the solution to read them via ABAP or JAVA is quite the same?)

Thx a lot !

sandra