generatePDFOutputBatch from com.adobe.fd.output.api.OutputService not working as expected. | Adobe Higher Education
Skip to main content
Wells_Sri
Level 2
January 5, 2024

generatePDFOutputBatch from com.adobe.fd.output.api.OutputService not working as expected.

  • January 5, 2024
  • 1 svar
  • 842 visningar

Hi,

 

generatePDFOutputBatch function producing output documents double the amount of input map. Please find the scenario below sample code snippet.

 

I am sending two templates with xml data and expecting two PDF documents as output, but it's produce 4 documents. I am bit confused, Any help please. Thanks.

 

input Maps:

Map templates = new LinkedHashMap();

Map data = new LinkedHashMap();

 

templates.put("xyz", "xyz.xdp");

templates.put("abc", "abc.xdp");

 

data.put("xyz", new Document(xml1))

data.put("abc", new Document(xml2))

 

BatchOptions bo = new BatchOptions();

bo.setGenerateManyFiles(true);

 

ret = outputService.generatePDFOutputBatch(templates, data, option, bo);

 

Output:

I am getting double the amount of documents in output like below metadata enties.

 

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Liquid Technologies Online Tools 1.0 (https://www.liquid-technologies.com) -->
<printBatchMetaData>
<batchId />

<recordMetaData>
<recordId />
<recordNo>1</recordNo>
<creationTime>01/02/24 17:18:14</creationTime>
<pages>1</pages>
<surfaces>1</surfaces>
<templateId>xyz</templateId>
</recordMetaData>
<recordMetaData>
<recordId />
<recordNo>2</recordNo>
<creationTime>01/02/24 17:18:14</creationTime>
<pages>1</pages>
<surfaces>1</surfaces>
<templateId>xyz</templateId>

</recordMetaData>

<recordMetaData>
<recordId />
<recordNo>1</recordNo>
<creationTime>01/02/24 17:18:16</creationTime>
<pages>21</pages>
<surfaces>21</surfaces>
<templateId>abc</templateId>
</recordMetaData>
<recordMetaData>
<recordId />
<recordNo>2</recordNo>
<creationTime>01/02/24 17:18:17</creationTime>
<pages>21</pages>
<surfaces>21</surfaces>
<templateId>abc</templateId>
</recordMetaData>

</printBatchMetaData>

Det här ämnet har stängts för svar.

1 svar

Adobe Employee
January 5, 2024

batch is used to generate multiple pdf files from one xdp template and different data files

https://experienceleague.adobe.com/docs/experience-manager-learn/forms/document-services/generate-multi-record-pdf.html?lang=en

 

Wells_Sri
Wells_SriSkribent
Level 2
January 6, 2024

you see my xml data contains just only one section of elements from a corresponding template. so i am expecting only one PDF out there, but it's producing two output PDFs like record 1 and record 2.