30 Replies Latest reply on Jan 23, 2009 7:01 AM by (Chris_Hicks)

    how to convert pdf data into xml

    Level 1
      Hi,

      I would like to know how to convert pdf data into xml i.e,
      for example let us consider the mortgage loan application, once the form gets completed (consider that Bank Manager has approved the loan)where this form will reside on the server..?
      and how to convert this pdf data into xml file..?

      thanx in advance.

      regards,
      sudheer.
        • 1. Re: how to convert pdf data into xml
          Jasmin Charbonneau Level 4
          Your question is a little bit vague, but let me try to answer.

          Once the PDF is displayed to the user, you can submit different things back to the server. You can submit the whole PDF, the XDP with data or just the XML (of the data).

          If you submit the PDF, you'll need a LiveCycle service to extract the data (Forms or Form Data Integration). If you just send the data back then, you're good.

          Now depending how the PDF was created, you might have the PDF in the repository on the server (which basically points to a database) or just have the XDP in the repository and the PDF is created at runtime.

          It really depends how you create your solution.

          If you expand a little bit more, I'll be more specific.

          Jasmin
          • 2. Re: how to convert pdf data into xml
            Level 1
            After the Bank Manager approves the data of the PDF need to be posted as XML to a JMS Queue, from where the ERP application can pick the data for further processing.
            • 3. Re: how to convert pdf data into xml
              Level 1
              Hi everyone,

              I am using a trial version of lifecycle and create a form, at the end which will export data into a .xml file. Using adobe profession I can export the .xml file but when I open this form into adobe 8.0 then its not working. Into the export button I write xfa.host.exportData("",0).
              Now suggest me what do I do? Is the problem will solve, If I buy the license version? Our organization ready to buy the product. but at first we need to know the solution

              regard
              himanshu
              • 4. Re: how to convert pdf data into xml
                Level 1
                Hi Himanshu,

                In your export button, under "Submit to URL" what is the url u specified..?
                I want to store the form as xml file in my local file system i.e, either C: or D:
                can u suggest me..?

                thanx in advance.

                sudheer.
                • 5. Re: how to convert pdf data into xml
                  (Aandi_Inston) Level 1
                  >In your export button, under "Submit to URL" what is the url u specified..?

                  It is a URL, starting http, https, or mailto.

                  >I want to store the form as xml file in my local file system i.e, either C: or D:

                  That is not submitting.

                  Aandi Inston
                  • 6. Re: how to convert pdf data into xml
                    Jasmin Charbonneau Level 4
                    Sudheer: LiveCycle has a JMS service under Foundation that can invoke a JMS queue or topic.

                    Jaydeep: Is it not working with Reader? You need to certify the PDF to be able to export the data from the PDF with the free Reader for security reasons.

                    Jasmin
                    • 7. Re: how to convert pdf data into xml
                      Level 1
                      hi jasmin,
                      when i run this form in adobe profession then its working, but if i open this form in adobe reader then its not working.i cant understand how could i certify the pdf.now i am using the trial version.if i register myself or purchase the product,is the problem will solve?

                      and hi shudeer, i think we are on the same board.i am also looking for the solution.
                      regard
                      himanshu
                      • 8. Re: how to convert pdf data into xml
                        Level 1
                        Hi All,

                        can someone suggest me any alternative to store my pdf as xml file in the local file system, currently I am using "submit by Email" button, this is working fine and I can able to downlaod the attachment as XML file but I want the same XML file to be stored in my local file system like either C: or D:

                        regards,
                        sudheer.
                        • 9. Re: how to convert pdf data into xml
                          Level 1
                          Hi,

                          I heard that we can store the pdf form as an xml file by configuring an endpoint like watched folder.
                          If this is true can someone help me how to achieve this..?

                          regards,
                          sudheer.
                          • 10. Re: how to convert pdf data into xml
                            Jasmin Charbonneau Level 4
                            Sudheer,
                            What is considered the "local file system". The file system of the end user or the file system where LiveCycle runs.

                            If it's on the server, you can just use the File Utilities service to write anything to the file system.

                            Jasmin
                            • 11. Re: how to convert pdf data into xml
                              Level 1
                              Hi,

                              Thanx a lot Jasmine, I tried to use the "WriteDocument" under File Utilities service but can't able to write a file to my desired location.
                              now let me explainn u what I did to achieve this and suggest me where I failed.

                              I have a business requirement, say I have 2 users i.e, "user1" and "user2". "user1" will submit the form and now the form gets routed to "user2".now "user2" approves the form.now the form data should be saved in form of a xml file to the file system where the LCES server is hosted.
                              I installed LCES server on LINUX machine and workbench on windows m/c.
                              now in my process designer I have setValue,user (from processManagement)and WriteDocument(from fileutilities).

                              my process designer looks like this:
                              setValue ---> user --> writeDocument
                              I have two variables i.e, xfaForm and document.
                              now, in the properties of writeDocument, I specified my parameters as follows:
                              1) Input Pathname Pattern : /home/adobe/mySample.xml("mySample" is the name of the file in which I want to store my form data as a xml file)
                              2) document (variable) : myDocument(this name of the variable of type document)
                              3)I checked the checkboxes of "mark unique" and "Over Write"
                              4)output result(variable):myDocument(this name of the variable of type document)
                              finally I have 2 questions here:
                              1) can I achieve this business requirement..?
                              2) did I specified properties correctly for all the services I used..?

                              kindly reply with ur suggestions/alternatives.
                              your help would be greatly appreciated.

                              regards,
                              sudheer.
                              • 12. Re: how to convert pdf data into xml
                                Jasmin Charbonneau Level 4
                                1) can I achieve this business requirement..?
                                Yes. This is a common use case.

                                2) did I specified properties correctly for all the services I used..?
                                They looked good. Do you get any error in the logs?

                                Also what variable are you using on the Form Data Mapping for the user step? This is the variable you want to output.

                                Jasmin
                                • 13. Re: how to convert pdf data into xml
                                  Level 1
                                  Hi Jasmine,

                                  Under the Form Data Mapping for the user step,
                                  1) input form variable --> /process_data/formdata (formdata is name of the variable of type xfaForm)
                                  2)output form data (variable)--> myDocument(this is name of the variable of type document) .
                                  3)task id and 4)completed user ID , I left them blank.

                                  but still I can't able to achieve this..?
                                  what should be my endpoint for this..?
                                  As of now I configured a endpoint with task manager and invoked it.
                                  kindly help me with your alternatives/suggestions.

                                  regards,
                                  sudheer.
                                  • 14. Re: how to convert pdf data into xml
                                    Level 1
                                    Hi All,

                                    Is there any tutorial availabe online with examples on how to use file utilities services ..?

                                    sudheer.
                                    • 15. Re: how to convert pdf data into xml
                                      Jasmin Charbonneau Level 4
                                      Set your output form data to the same as the input form variable which is /process_data/formdata since you're just interested into the XML.

                                      You can add a variable logger after to see the content of the variables.

                                      Jasmin
                                      • 16. Re: how to convert pdf data into xml
                                        Level 1
                                        Hi Jasmine ,

                                        Here is the log that I got :

                                        [PID:314] [ActionID:343] Action Name: "output logs" Start...
                                        [PID:314] /process_data/formdata - com.adobe.idp.taskmanager.form.impl.xfa.XFARepositoryFormInstance: com.adobe.idp.taskmanager.form.impl.xfa.XFARepositoryFormInstance@4bc2c29

                                        [PID:314] /process_data/myDocument: null

                                        [PID:314] /process_data/resultString: null
                                        Variable Properties:
                                        VP1197282831588:length = ["\home\adobe\test\sample.xml"]
                                        [PID:314] [ActionID:343] End!

                                        "resultString" is the variable of type "String"

                                        why I am getting null for document..?

                                        reply me with ur comments.

                                        sudheer.
                                        • 17. Re: how to convert pdf data into xml
                                          Jasmin Charbonneau Level 4
                                          Under the User's "Forms Data Mapping" you're using /process_data/formdata so only that variable contains data.

                                          You need to populate the myDocument variable with data before you use the "Write Document" service. Use a SetValue and set the following:
                                          /process_data/@myDocument = /process_data/formdata/object/data.

                                          At this point myDocument will contain the xml data and you should be write it out to the file system.

                                          Jasmin
                                          • 18. Re: how to convert pdf data into xml
                                            Level 1
                                            thank you very much Jasmine..!

                                            I can able to achieve it.
                                            thanx for your continuous outstanding support and I really appreciate for your timely response.

                                            regards,
                                            sudheer.
                                            • 19. Re: how to convert pdf data into xml
                                              Level 1
                                              Hi Jasmine,

                                              I need a small help form you, with respect to our prevoius discussion I can able to save the form data as an XML file but here I want to store the XML file with the name of the form creator i.e, if Kel Varsen is the form creator then I want the name of the xml file as "kvarsen.xml" i.e, the name of the form should change with respect to the form creator. can we achieve this..?if so how to proceed..?

                                              thanx in advance

                                              regards,
                                              sudheer.
                                              • 20. Re: how to convert pdf data into xml
                                                Jasmin Charbonneau Level 4
                                                What you'll need to do is make a database call using the JDBC service and get the name associated with the process creator id.

                                                First create a variable of type sting that will contain the name of th user. Then, drop a "Query Single Row" operation from the JDBC service in your process and put the following SQL statement :

                                                select commonname from edcprincipalentity where id = '{$/process_data/@creator_id$}'

                                                Set the data source name to be java:/IDP_DS

                                                Under Data Mapping click Process Metadata. Associate your user name string variable to the index 1 (common name). It'll put the common name in your variable.

                                                From there you should be able to build the file name with the value of that variable.

                                                Jasmin
                                                • 21. Re: how to convert pdf data into xml
                                                  Level 1
                                                  Hi,

                                                  thanx for the help..!
                                                  I did everyting as u suggested, but I had a problem while executing the query, I used the same query given by u but if I test this query I got the following exception:

                                                  Exception: Internal error.. Cause: ALC-DSC-000-000: com.adobe.idp.dsc.DSCRuntimeException: Internal error.

                                                  Also, Under Data Mapping when clicked on Process Metadata no action is taken place.
                                                  Kindly help me in resloving this issue.

                                                  regards,
                                                  sudheer.
                                                  • 22. Re: how to convert pdf data into xml
                                                    Level 1
                                                    Hi Jasmine,

                                                    I also need a small help in how to define a variable of type sting that will contain the name of the user.
                                                    I defined a variable of type String, but I don't know how to pass the name of the user to this string variable...?

                                                    regards,
                                                    sudheer.
                                                    • 23. Re: how to convert pdf data into xml
                                                      Jasmin Charbonneau Level 4
                                                      What's the error in the log.
                                                      If you you put select commonname from edcprincipalentity and hit test doesn't it work?

                                                      Once the sql stmt works, the variable string will be populated by the "Data Mapping" settings.

                                                      Jasmin
                                                      • 24. Re: how to convert pdf data into xml
                                                        Level 1
                                                        Hi Jasmin,
                                                        i have a filled pdf created in lifecycle designer 8.2.
                                                        i am now trying to extract xml form this pdf document.
                                                        I installed the trail version of Lifecycle Es.

                                                        I am am using the code

                                                        Properties ConnectionProps = new Properties();

                                                        ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "t3://localhost:8001");

                                                        ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,Service ClientFactoryProperties.DSC_EJB_PROTOCOL);

                                                        ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "WebLogic");

                                                        ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");

                                                        ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");

                                                        ServiceClientFactory service =ServiceClientFactory.createInstance(ConnectionProps) ;
                                                        FormDataIntegrationClient client = new FormDataIntegrationClient(service);

                                                        FileInputStream fin = new FileInputStream("C:\\bgform.pdf");

                                                        Document doc = new Document(fin);
                                                        Document xmlDoc = client.exportData(doc);

                                                        // File outXmlFile = new File("c:\\bgform.xml");
                                                        // xmlDoc.copyToFile(outXmlFile);
                                                        } catch (Exception e) {
                                                        e.printStackTrace();
                                                        }


                                                        to extract the xml data. but when i run it it errors out

                                                        com.adobe.livecycle.formdataintegration.client.ExportFormDataException: java.lang.IllegalStateException
                                                        at com.adobe.livecycle.formdataintegration.client.FormDataIntegrationClient.exportData(FormD ataIntegrationClient.java:224)
                                                        at com.aicpa.extractxml.ExtractXML.main(ExtractXML.java:45)
                                                        Caused by: java.lang.IllegalStateException
                                                        at com.adobe.idp.dsc.clientsdk.ServiceClientFactory$1.handleThrowable(ServiceClientFactory.j ava:67)
                                                        at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:220)
                                                        at com.adobe.livecycle.formdataintegration.client.FormDataIntegrationClient.invokeRequest(Fo rmDataIntegrationClient.java:237)
                                                        at com.adobe.livecycle.formdataintegration.client.FormDataIntegrationClient.exportData(FormD ataIntegrationClient.java:207)
                                                        ... 1 more
                                                        Caused by: java.lang.NoClassDefFoundError: javax/ejb/EJBException
                                                        at com.adobe.idp.dsc.clientsdk.ServiceClientFactory.evaluateMessageDispatcher(ServiceClientF actory.java:558)
                                                        at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:215)
                                                        ... 3 more
                                                        Process exited with exit code 0.

                                                        what am i doing wrong please advise. why is tis exception raised.

                                                        thanks,
                                                        vikram
                                                        • 25. Re: how to convert pdf data into xml
                                                          Level 1
                                                          i am also facing similar exception when i am trying to export the data from pdf to xml.
                                                          anybody knows the cause of this error?
                                                          • 26. Re: how to convert pdf data into xml
                                                            Level 1
                                                            Hello

                                                            I have a similar requirement. We have a form developed using livecycle designer 8 and would like to host this on our website. When users fill out the form and click on submit, the form data should be ftp'ed to a server location either in .xml or delimited text.

                                                            appreciate your help.
                                                            • 27. Re: how to convert pdf data into xml
                                                              pguerett Level 6
                                                              Acrobat does not do FTP for submissions. You could submit to an intermediate application (like a servlet) and FTP from there to your server.
                                                              • 28. Re: how to convert pdf data into xml
                                                                Level 1
                                                                Paul,
                                                                You are right. This is exactly i was thinking. But, iam not sure what I need to do in the livecycle designer submit button property to call/ invoke my servlet.

                                                                Do I need to do anything additionally in livecycle designer, like creating a new data connection?

                                                                My servlet will be deployed in tomcat 6.x and it will have the form parameters.

                                                                eg:

                                                                //inside my doGet(), assuming that my form has 2 textfields "firstname" and "lastname"

                                                                request.getParameter("firstname")
                                                                request.getParameter("lastname")

                                                                //inside my doPost()
                                                                -- i have to call my doGet() ??
                                                                • 29. Re: how to convert pdf data into xml
                                                                  (MEHUL_PARESHBHAI_THAKOR) Level 1
                                                                  HELLO...
                                                                  I AM NEWBIE TO ADOBE LC WORKBENCH
                                                                  I UNDERSTOOD THE MORTGAGE LOAN APPLICATION AND LEARN TO CREATE PROCESS AND FORM.

                                                                  I WANT TO CREATE A PROCESS WHICH CAN EXTRACT DATA FROM PDF FORM IN XML FILE.'
                                                                  CAN ANYONE GIVE STEP BY STEP TUTORIAL OR EXAMPLE FOR THIS...
                                                                  • 30. Re: how to convert pdf data into xml
                                                                    Level 1
                                                                    You would use the FormsService to extract the data from the pdf. There is an example shipped with the product...

                                                                    DataExtractionAndUpdateDB