Get attachments from pdf

I have a problem that is urgent. I want to extract attachements from a pdf file using java apis. I started from an example buf the BIG problem is that i don't have a documentation for certain java classes.<br />A piece of my code:<br /><br />PDFDocument pdfDoc = pdfFactory.openPDF(pdfFile);<br />try{<br />      EmbeddedDataObject[] edoList = pdfDoc.getDataObjectList();<br />      if (edoList.length>0){<br />         for(int i=0;i<edoList.length;i++){<br />        try{<br />           DataBuffer edodb = pdfDoc.exportDataObject(edoList[i].name);<br /><br />        }<br />        catch (Exception e){}<br />}<br />catch (Exception e){}<br /><br />DataBuffer is com.adobe.service.DataBuffer, buf i can't find documentation for it.<br />Please help.<br /><br />Regards, bogdan

If you need code-level help, you should open a formal support incident with our Developer Support folks.
From: Adobe Forums <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Date: Tue, 24 Jan 2012 23:13:52 -0800
To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
Subject: How to get file attachments from a pdf.
Re: How to get file attachments from a pdf.
created by poortip87<http://forums.adobe.com/people/poortip87> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4163393#4163393

Similar Messages

  • How to get data from PDF form?

    PDF forms can send data in url like GET or POST method. Is it possible to get data from url, like in PHP http://sever/file.php?item1=value1&item2=value2&item3=value3
    In APEX url have specific construction and I don't know how to get value of items (1...3)
    Please let me help to find simple method of geting data from URL.
    Best Regards,
    Mark

    The APEX URL syntax is detailed here
    http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/concept.htm#BCEDJBEH
    How to get it from PDF is another matter...
    I'm working on an app that downloads PDFs with a Large amount of data as a blob, takes that blob and changes it to XML, then goes through the xml to validate each section of data and then add it into the schema that my apex app is referencing....
    I didn't write the original code but I do know that it isn't a quick thing to implement and includes using some uploading some java jar files to your schema and writing some custom java code.
    Someone else may be able to help with grabbing PDF data into the URL for the amounts of data you want to pass to apex.
    Gus..
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!
    Edited by: Gussay on Sep 21, 2009 5:52 PM

  • Getting Thumbnails from PDF

    Hello,
    When we use Acrobat Professional to "Create PDF" using "From File" , Acrobat is internally creating the thumbnails for each page and storing these information in one of the layers. I would like to know how to extract those already generated Thumbnail images from PDF using ACrobat SDK.
    Questions:
    1. Is there any mechanism to achieve this using Acrobat SDK?
        Performance is the criteria I am looking for as far as extracting the thumbnails are concerned.As Acrobat has already created the thumbnail data, I would like to reuse/get it which I feel would enhance the performance.
    2. I tried PdPage.CopyToClipbpoard() which would give a thumbnail image but its not matching the performance criteria. In this approach we are re-creating the thumbnails anyway which I would not prefer.
    Please help.
    Thanks
    Praveen

    Your first statement is incorrect.  Acrobat hasn't generated embedded thumbnails of pages since version 6.
    You mention, CopyToClipboard(), which implies to me that you are trying to do this through the COM interfaces - those are going to be slower than working with the plugin interfaces, but plugins require C/C++.  If you do stick with COM, then you should look at the drawing interfaces used by the Static and Active samples in the SDK - those will be much faster than copy to clipboard.

  • Read and Get Data from PDF

    Hi All,
    I am fairly new to programming macros in Excel VBA, and right now I need to write a macro that can open a PDF file and read it and get data from there and paste it into an excel spread sheet. Is this possible?  If so can you give me some sample code
    that would do that?

    I did this once many years ago.  I had to have Acrobat Professional installed ($$$).  There are free pdf parsers that you access from VBA using Win32 commands like:
    https://code.google.com/p/peepdf/
    Maybe something has changed since I did it

  • Including attachments from PDF in Save as Draft and Submit as XDP

    When I wrote the first large process years ago, I ran into the problem of saving attachments that are in the PDF. If you ask the question, the response will be that you have to submit as PDF. That in turn has it's own other problems which when trying to solve, the answer given is "That is because you are submitting as a PDF". I have seen many ask the same thing I wanted: Submit as XDP, but include the attachments. This also includes that the built in Save Draft save them too.
    The summary is this: Loop through the attachments in JavaScript, Base64 encode them and stick them into the DOM. On the server side, use a script step to loop through and create a map of document objects to pass to the next render.
    The following needs to be called from a preSubmit event passing event.target. You'll need to add the nodes referenced to your schema.
    function embedAttachments(oParent) {
        // Get the list of attachments
        var oDataObjects = oParent.dataObjects;
        //app.alert(oDataObjects);
        var rootNode = xfa.datasets.data.resolveNode("[Your Data Root Node]");
        var oAttachData = rootNode.nodes.namedItem("FileAttachments");
        var oldNodes = oAttachData.nodes;
        //wipe out empty nodes
        while (oldNodes.length != 0) {
          oldNodes.remove(oAttachData.nodes.item(0));
        if (oDataObjects != null) {
          var count = oDataObjects.length;
          if (count > 0) {
              // Loop through all the attachments
              for (var i = 0; i < count; i++) {
                // Grab the next attachment
                var oFile = oParent.getDataObjectContents(oDataObjects[i].name);   
                  // Get a new stream with the image encoded as base64
                var vEncodedStream = Net.streamEncode(oFile, "base64");
                // Get a string from the stream
                var sBase64 = util.stringFromStream(vEncodedStream);
                  //console.println(sBase64);
                  // Copy the data to the XML
                var oNewNode = xfa.datasets.createNode("dataGroup", "FileAttachment");
                oAttachData.nodes.append(oNewNode);
                var oName = xfa.datasets.createNode("dataValue", "FileName");
                var oDesc = xfa.datasets.createNode("dataValue", "FileDesc");
                var oData = xfa.datasets.createNode("dataValue", "Base64Data");
                oName.value = oDataObjects[i].path;
                oDesc.value = oDataObjects[i].description;
                oData.value = sBase64;
                oNewNode.nodes.append(oName);
                oNewNode.nodes.append(oDesc);
                oNewNode.nodes.append(oData);   
    It also needs to be called from ContainerFoundation_JS in the form bridge.
    Add this variable:
    var thisDoc = null;
    Add this line of code at the top of RegisterMessageHandler:
        thisDoc = event.target;
    Add this line of code to the top of getData function:
    xfa.form.[Root Node].[Script Object].embedAttachments(thisDoc);
    Here is the Java code to add to a script object. I put mine in a custom render.
    import java.util.HashMap;
    import java.util.*;
    import org.w3c.dom.*;
    import com.adobe.idp.Document;
    import org.apache.commons.codec.binary.Base64;
    int count = 0;
    Map attachmentMap = new HashMap();
    Node ndAttach = patExecContext.getProcessDataValue("/process_data/xmlData/Formdata/FileAttachments");
    if (ndAttach != null) {
        NodeList children = ndAttach.getChildNodes();
        if (children != null) {
            count = children.getLength();
    for (int i = 1; i <= count; i++){
        String name = patExecContext.getProcessDataStringValue("/process_data/xmlData/Formdata/FileAttachments/ FileAttachment[" + i + "]/FileName");
        String desc = patExecContext.getProcessDataStringValue("/process_data/xmlData/Formdata/FileAttachments/ FileAttachment[" + i + "]/FileDesc");
        String b64Data = patExecContext.getProcessDataStringValue("/process_data/xmlData/Formdata/FileAttachments/ FileAttachment[" + i + "]/Base64Data");
        if (b64Data != null && b64Data.length() != 0) {
            Document attDoc = new Document((new Base64()).decode(b64Data.getBytes()));
            attDoc.setAttribute("basename", name);
            attDoc.setAttribute("description", desc);
            attDoc.setAttribute("wsPermission", "1");
            attDoc.passivate();
            attachmentMap.put(name, attDoc);
    patExecContext.setProcessDataMapValue("/process_data/mapAttachments", attachmentMap);
    After I wrote that, I realized there is a method to create a document from Base64. Since I can inspect the map during record and play back and see that the documents are stored Base64, I think I could speed up the process by changing to the other method. I am assuming it would prevent a decode then encode. This same technique might also be applied to annotations.

    Revised Execute script. Server was running out of heap space with large attachments. Creating the Document objects as temp files instead of in memory solves that. I also added the part that wipes the Base64 Attachments out of the XML.
            int count = 0;
            Map attachmentMap = new HashMap();
            String name="";
            String b64Data="";
            File tempFile=null;
            FileOutputStream outStream=null;
            Document attDoc=null;
            int i=0;
            Node ndAttach = (Node) patExecContext.getProcessDataValue("/process_data/xmlData/Formdata/FileAttachments");
            NodeList children;
            Node childNode = null;
            if (ndAttach != null) {
                children = ndAttach.getChildNodes();
                if (children != null) {
                    childNode = children.item(i);
                    if (childNode instanceof Element) {
                        System.out.println("tag name: " + ((Element)childNode).getTagName());
                    count = children.getLength();
            for (i = 1; i <= count; i++){
                b64Data = patExecContext.getProcessDataStringValue("/process_data/xmlData/Formdata/FileAttachments/FileAttachment[" + i + "]/Base64Data");
                if (b64Data != null && b64Data.length() != 0) {
                    name = patExecContext.getProcessDataStringValue("/process_data/xmlData/Formdata/FileAttachments/FileAttachment[" + i + "]/FileName");
                    tempFile = File.createTempFile("Attachment", ".tmp");
                    outStream = new FileOutputStream(tempFile);
                    outStream.write(Base64.decodeBase64(b64Data.getBytes()));
                    outStream.close();
                    attDoc = new Document(tempFile, true);
                    attDoc.setAttribute("basename", name);
                    attDoc.setAttribute("description", patExecContext.getProcessDataStringValue("/process_data/xmlData/Formdata/FileAttachments/FileAttachment[" + i + "]/FileDesc"));
                    attDoc.setAttribute("wsPermission", "1");
                    attachmentMap.put(name, attDoc);
            patExecContext.setProcessDataMapValue("/process_data/mapAttachments", attachmentMap);
            while (ndAttach.hasChildNodes()) {
                ndAttach.removeChild(ndAttach.getLastChild());

  • Convert attachments from pdf to jpeg

    I received some photos as pdf attachments and i need to convert them to jpeg to save them in my iPhoto library

    Drag the Preview application from your Applications folder to the Dock, if it is not already there.
    Then save the attachments to your Desktop from Mail.
    Drag each attachment to the Preview icon to open it in Preview.
    Alternately, you can right-click or ctrl-click a document and use the command "Open with" from the contextual menu to force the document to open in a specific application.

  • How to get data from pdf file and send contents  of the pdf file to R/3

    Hi, experts,
    Action:
    1. Make a pdf forms (interactive form) with inputfield named “A_inputfield” in the webdynpro application and run the webdynpro application.
    2. In the IE, click the save button in the pdf interactive form and save the pdf to local disk,ex: C disk. Close the IE browser.
    3. Open the pdf interactive form from the local C disk and type "aaa" to the “A_inputfield”.
    4. I want to save the "aaa" to the R/3 system using webdynpro or using other tools . How can I do it?
    First way:
    If I use webdynpro application to save the content of the pdf, I don't find a way mapping or binding the content to a context of a view. So I don't think this way is unadvisable.
    Second way:
    Adding a button "submit" in the pdf forms when create the pdf form. Runing the webdynpro application, save the pdf to local disk,ex: C disk.  Opening the pdf interactive form from the local c disk and typing "aaa" to the “A_inputfield”, click the  "submit" button to save the content. Of course, I need to finish the code for clicking "submit" button. But I don't know how  to write these codes and where to write these codes. Do you give me some advise ?
    Best regards,
    tao

    Hi, Abhimanyu L,
    Thanks a lot for your help. Your answer can give me large developmental.:)
    I find http://help.sap.com/saphelp_erp2005/helpdata/en/67/fae9421dd80121e10000000a155106/content through searching google for CL_WD_ADOBE_SERVICES class. But I don't find any exmples for the class. Do you give me some hint for some exmples for the class?
    Best regards,
    tao
    (You can reply back to me via e-mail if you think we should discuss this internally at [email protected] or [email protected])

  • Retreiving attachments from PDF

    As you know, attachments can be added to PDF forms. I would like to know how can I retrieve these attachments and use them in Workbench ?
    Thanks
    Aditya

    I am using:
    Category: Forms
    Service Name: FormsService
    Service Operation: processFormSubmission
    The attachments come in off that as a list. I am then using the following script to move into a map for use in a later render:
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;
    import java.util.Iterator;
    import com.adobe.idp.Document;
    List attachmentList = patExecContext.getProcessDataListValue("/process_data/lsAttachments");
    Map attachmentMap = new HashMap();
    Iterator it = attachmentList.iterator();
    while(it.hasNext()){
    Document attDoc = (Document) it.next();
    String name = (String) attDoc.getAttribute("name");
    attachmentMap.put(name, attDoc);
    patExecContext.setProcessDataMapValue("/process_data/attachments",attachmentMap);
    attachmentList.clear();
    patExecContext.setProcessDataListValue("/process_data/lsAttachments", attachmentList);

  • Mail changes my attachments from PDFs to Jpegs - Help!!

    I have to send PDF visuals to my clients but sometimes when I attach the PDF to the email, Mail converts it to a Jpeg, which is no good as it looks crap at the other end. Has anyone else seen this ? Is there a way to stop it ?

    Hello, and welcome to the Discussions.
    I have produced this problem, but only when having first attached another file, and used the size button to reduce the size from Actual. After the change from Actual Size, then a PDF would be presented as a JPEG.
    However, in all tests, if the first act of attachment was the PDF, the starting position was Actual Size, and the PDF remained a PDF file. You cannot use the Size button to reduce the size of PDF files, but must go other routes.
    I have reported this behavior, however, the only problem in my opinion, is that a file type can be changed without warning, and not the function of this size button. The size button is really intended to allow easy resizing of photos, and probably should be limited to photos. For example, if a .tif file were switched to .jpg, it is still an image, and convenient size to send is made possible.
    More info, please, about your exact experience.
    Ernie

  • Get rectangle from pdf C#

    Hi I displaying my a pdf on my form using the Adobe PDF Reader
    Once displayed the user can draw a rectangle using the Selection tool within Adobe
    I would like to know if there is a way i can get the coordinates for the rectangle drawn by the selection tool

    I don’t believe so, no.

  • Getting help from PDF rather than web

    Everytime I click on help I find that PSE 7 wants to open my browser to apparently consult the help file on the web.  This seems absurd when I understand that all of the same data is available in the PDF file.  How do I get the program to stop looking up the web?

    If you have already downloaded the PDF help files, then there is no use of clicking help links in the application. This will ultimately retrieve you the same information that is already in the PDf files.
    Regards.

  • How to extract word coordinates from PDF using vc++6.0

    In sdk,i just know how to get coordinate from pdf using javascript,and it will be completed use vb.but i dont know how to get the coordinate througt vc++6.0.anyone can help me?
    thank you advance!

    PDEWordFinder is the usual method for getting words and co-ordinates.
    PDFEdit is not usually used, it is not suitable for getting text.
    It is very hard work to make the two worlds work together (e.g. to
    edit text you find).
    Aandi Inston

  • How do I get my ipad to recognise my pdf attachments as pdfs?

    My ipad does not always recognise a pdf file as as incoming mail attachment, so I cannot always open the pdf in another app.
    Although the attachment shows as a paperclip in the mail header, sometimes the content of the attachment is displayed in the body on the email. When this happens I don't get the small square window at the top right corner of the screen where you can select another app to open the pdf.
    How do I get my ipad to recognise my pdf attachments as pdfs and not show the content in the body of the mail message?

    This is from page 44 of the iPad User Manual:
    Open a meeting invitation or attachment: Tap the item. If the attachment can be used by multiple apps, touch and hold to choose an app that works with the file.
    Based on this, I suggest trying this:
    Touch and hold an area of the PDF file that displays in the body in your email.  Do you get the behavior described in the manual above?

  • How can I print PDF attachments from ABAP report in transaction ME23N?

    Hi,
    Users attach PDF files using "services for objects" in transaction ME23N.
    How can I print the PDF attachments from ABAP report ?
    Thanks in advance,,

    Hi,
      check this link,this might help you to solve your problem
    /people/thomas.jung3/blog/2005/04/28/setting-up-an-adobe-writer-for-abap-output
    Regards
    Kiran Sure

  • Unable to view PDF attachments from my iPhone.

    I am using service called RightFax this service is send the faxes to clients mailboxs. I have been reported from clients that they are unable to view the attachmentson their iPhones, the attachment format is PDF. The attachment can be openned from any desktops and Android phones without any issue.
    i can see attachment from on my iPhone but when i tab on it to view it it just scrolled up to the top of the mail. Also if i farward the same fax mail to my self then i can view the attachment.The IOS version is 7.1.
    I contact the RightFax company to check with them why only attachments from fax mails with PDF format is not openning from iPhone devices from the first time, the company check theur services and do tests and reply me that there is no issue with their services since the PDF attachments are openned on android and desktops. They informed me that it might could be compatability issue between Exchange 2013 and apple that doesn't allowed PDF attachments to be openned from the first time, so they advised to contact Apple support to find out why PDFs are not openning when i initially attempt to download them.
    I download third party mail client on my iPhone and all fax attachments are openned without problem.
    Could anyone help me with this strange issue ??

    RightFax advised you to contact Apple Support - this is NOT Apple Support but rather a public user to user technical support forum.
    As far as I know, it is not possible to open PDF attachments on an iPhone, but it is on an Android phone, which is why you are having the problems - unless there is an app to help you that you can purchase in the app store, then there is not a lot you can do about this, except switch to an android phone, but as far as I know, you have never been able to open PDF documents on an iPhone.

Maybe you are looking for