Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

generate a process which generates pdfoutput

Avatar

Level 2

Hi

i want to automate generating pdf with output..

until yet i call as a web service OutPutService in my dotnet application

in this application i merge a file.xdp with a file.xml. As there are several record in my file.xml the result is several file.pdf.

until yet it is ok.

But i want to automate this process by create a process in workbench.

i want this process to generatePDFOutput with file.xml and file.xdp in input and i want this process to permit me to count all the pdf file which are generated, the date of creating file and at the end of the process, it should be send an email to user that inform the user of the number of pdf generated and the date of creating.

i am a very beginner and i don't know (even with the quickstart creating process) what to do and how to begin.

i created a process with generatingpdf operation but i don't know how to count the number of pdf generated.

thanks for help

1 Accepted Solution

Avatar

Correct answer by
Level 8

The process is long-lived and so it must be executed asynchronously. You can either:

  • change the process to be short-lived using the advanced tab of the process propeties (http://livedocs.adobe.com/livecycle/8.2/wb_help/000278.html)
  • change your code to execute it asynchronously (http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/000285.html)

View solution in original post

10 Replies

Avatar

Level 10

You can loop through the number of records available in the xml file.

Create a counter variable (of type Integer) and increment the count for each PDF generation.

By default, there is a function called count which is used to find the number of nodes in the given xml. So you can also make use of that.

Create a list variable with subtype of document to save your generate pdf documents.

If you can send a form template and sample data file (the .xml & .xdp files), i would explain you in detail.

Nith

Avatar

Level 2

ok thanks

but i know extracting by my project dotnet  number of element in my file.xml, i don't want to do that.

i want to create a process in workbench which automate this process :

xml+xdp -> generatepdfoutput-> number(n) of pdf generate-> send email to a user input : you have generate n pdf at this date time, on this folder.

after that to run the project, i just call it by adding web reference in my dot net project and invoke it

Avatar

Level 10

The generatepdfoutput component will generate only one PDF at a time.

So either you need to invoke the process 'n' times from the .net code which is not suitable for your case (for sending email from workflow)

Or you need to make a loop inside the process to generate multiple PDFs.

Thanks & Regards,

Nith

Avatar

Level 2

oh!

ok so i have to create a process which loop and read my xml element by element and for each element  go to generatePDFOutput which generate one pdf

and when my loop is at its end i send a mail you have generate n pdf?

and what about the option generate multi stream in property batch of the operation generatePdfOutput?

thanks for you help, i am a novice in live cycle and i am a little lost actually..

Avatar

Level 10

I'm not sure that property will produce multiple PDF document. The PDF Output is the one which is returned by the generatePDFOutput service.

Anyways, confirm your assumption with someone else. I don't have knowledge on the multiple streams property.

Thanks & Regards,

Nith

Avatar

Level 8

The Batch properties of GeneratePDFOutput are used to generate multiple PDFs from one XML file. The XML has to be structured as a series of 'records'.

There is s good explanation in the LiveCycle Services guide, at http://www.adobe.com/go/learn_lc_services_82. In the bookmarks, go to  Output Service > Using The Output Service > Processing Batch Data To Product Multiple Documents.

scott

Avatar

Level 2

it's ok when i call output service and i set render option generate multi file = true and recordname = name_element and i put <batch> </batch>

in the beginning end end of my xml file it's running.

My problem is that i want to create a process with operation generatepdfOutput and something in this process should count the number of pdf generate and when all is generate it should send a email to a user provide in input.

actually i am far for that because just create a process with generatePdfOutput seems to be impossible!!!!

when i invoke the process and give the parameter i have a probleme with one of them : dataxml which should give the path of the xml file which contain the data.

in my process i define xmldata as a variable document input and i do that in my code :

BLOB inData = new BLOB();

String inPutFile = "C:\\creerPdf\\PurchaseOrder.xml";

FileStream fs = new FileStream(inPutFile, FileMode.Open);

int longueur = (int)fs.Length;

Byte[] byteArray = new byte[longueur];

fs.Read(byteArray, 0, longueur);

inData.binaryData = byteArray;

BLOB generatePDFOutputMetaDataDoc = new BLOB();

BLOB generatePDFOutputResultDoc = new BLOB();

OutputResult outResult = new OutputResult();

EssaiOutputService essaiOutput = new EssaiOutputService();

essaiOutput.Url +=

"?blob=base64"

;

essaiOutput.Credentials =

new System.Net.NetworkCredential("administrator", "password");

generatePDFOutputMetaDataDoc = essaiOutput.invoke(

"c:\\creerPdf", inData, "BonCmdeDynamiq.xdp", out outResult, out generatePDFOutputResultDoc);

and it renders this error :

ALC-DSC-127-000: com.adobe.idp.dsc.LongLivedInvocationException: The Long Lived Service EssaiOutput can not be invoked synchronously.

is somoene knowing what it is wrong?

Avatar

Correct answer by
Level 8

The process is long-lived and so it must be executed asynchronously. You can either:

  • change the process to be short-lived using the advanced tab of the process propeties (http://livedocs.adobe.com/livecycle/8.2/wb_help/000278.html)
  • change your code to execute it asynchronously (http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/000285.html)