Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

DDX source file

Avatar

Former Community Member
From ADS, we can get the source "map" like this:<br /><loadContent source="file://C:/map.pdf" out="map" /> <br /><br />How can I get the source fileIn1 path specify here?<br /><br />var xmlShell ='<?xml version="1.0" encoding="UTF-8"?>\n\<br /><DDX xmlns="http://ns.adobe.com/DDX/1.0/">\n\<br /> <PDF result="out.pdf">\n\<br /> <PDF source="fileIn1"/>\n\<br /> </PDF>\n\<br /></DDX>\n';<br /><br />I tried to put a variable <br />var fileIn1="c:\map.pdf"<br />and it is not working.<br /><br />The above example is from the commands.jsp, which is from the adobe samples directory.<br />The exiting commands.jsp is using the <input type=file name=fileIn1> to get the value.<br /><br />I don't need users to select the documents. <br /><br />How could I do that?<br /><br />Thanks,<br /><br />Carol
5 Replies

Avatar

Former Community Member
The developer guide and the servlet.java have examples along these lines. Basically you need to construct a Document object with the file, and put that document object in the input map. Something like this pseudo-code:



// make the input document

Document inDoc1 = new Document("C:\\map.pdf", false);

// make the input map

Map inputs = new HashMap();

// put the document in the map under the correct key

inputs.put("fileIn1", inDoc1);



Don

Avatar

Former Community Member
Thanks Don.



If the file is not sitting on the local driver. For example, if the the file is here: http://www.adobe.com/test/test.pdf.

Can we write like this?

Document inDoc1 = new Document("http://www.adobe.com/test/test.pdf", false);



Sorry, I am a newbie here.



Thanks,



Carol

Avatar

Former Community Member
In the javadocs under C:\Adobe\LiveCycle\Assembler\Documentation\javadocs\assembler_api\index.html, it does look like there is a Constructor for Document that takes an URL object. So you could do something like:

Document inDoc1 = new Document(new java.net.URL("http://www.adobe.com/test/test.pdf"));

Avatar

Former Community Member
What does the mapItem output look like if it's being called via Web Services (in this case, from a .NET environment)?



(I.e., do I need to prefix this with a file:// ??)