Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

how to get total page count

Avatar

Level 2

Is there anyone know how to get the total page after we generate the pdf file. I'm using the rest method and create a out process.?

1 Accepted Solution

Avatar

Correct answer by
Level 2

In workbench I use a SetValue

Before you assemble the document you need to build the DDX string and specify you want the xml info.

concat(/process_data/@ddxHeadStr, ' <DocumentInformation source="mergedPDF" result="doc_info.xml" />')

AFTER Assembly

Use SetValue set your xmlinfo variable (type xml) to this

/process_data/xmlInfo Set TO

/process_data/assemblerResult/object/documents[@id

="doc_info.xml"]

Then get your pages from the XMLinfo

/process_data/@numPages

=

/process_data/xmlInfo/DocInfo/NumPages

Hope this helps.  Email if not clear.  I had to fight through this recently and feel the documentation is really lacking.

View solution in original post

8 Replies

Avatar

Level 8

Page count is one of the data points returned when you use the docInfo tag in a DDX.

Avatar

Level 2

do you have any specific information, more details, sample? thanks for quick response

Avatar

Level 8

DocInfo is a tag set that is part of the DDX command file.  LiveCycle Assembler uses a DDX file to determine what it is supposed to do to a file.  Have a look at the DDX reference guide: http://livedocs.adobe.com/livecycle/8.2/ddxRef/001000.html

and specifically at the Doc Info part:

  http://livedocs.adobe.com/livecycle/8.2/ddxRef/001170.html

(You can see the table of contents from the above links by clicking on the "Show Navigation" icon in the upper left)

Avatar

Correct answer by
Level 2

In workbench I use a SetValue

Before you assemble the document you need to build the DDX string and specify you want the xml info.

concat(/process_data/@ddxHeadStr, ' <DocumentInformation source="mergedPDF" result="doc_info.xml" />')

AFTER Assembly

Use SetValue set your xmlinfo variable (type xml) to this

/process_data/xmlInfo Set TO

/process_data/assemblerResult/object/documents[@id

="doc_info.xml"]

Then get your pages from the XMLinfo

/process_data/@numPages

=

/process_data/xmlInfo/DocInfo/NumPages

Hope this helps.  Email if not clear.  I had to fight through this recently and feel the documentation is really lacking.

Avatar

Level 2

Finally, I got it works. A Big thanks for all helping me.


Avatar

Level 1

Hi,

Using DDX how to get the total number pages for given PDF/binaryData, please give the sample code

Avatar

Level 1

Hi tried to modify DDX with

<DocumentInformation source="mergedPDF" result="doc_info.xml" />

But how can get the doc_info.xml and how to get the number of pages ??

Avatar

Level 1

I am attempting to split a PDF that is input into a process via a watched folder. I have a sample DDX process that works to split it apart into individual files, but the default page number is hard coded in this sample. I tried using the method above to get the number of pages from the input PDF instead of the merged PDF, but I am getting errors. Should this work to get the total pages if the PDF is not the result of a DDX assembler process?