Highlighted

Retrieving Page Count on an Assembled Document

Avatar

Guest

25-08-2008

I need to be able to retrieve the number of pages in a PDF returned from the Assembler Service. I can retrieve the com.adobe.idp.Document object, but it does not have a getPageCount() method.



I need something similar to what the Forms service has, the FormsResult object has a getPageCount() method, but the AssemblerResult does not.



Anyone know how to do this?



Thanks,

Karl.

Replies

Highlighted

Avatar

Guest

02-09-2008

The way to do this is to add a following result block to return information in XML format about the document you created.



For example, in your DDX you would have a PDF result block followed by a DocumentInformation result block where the PDF source is the PDF result from the previous result block:



<?xml version="1.0" encoding="UTF-8"?>

<DDX xmlns="http://ns.adobe.com/DDX/1.0">



  <PDF result="out.pdf">

    ... other ddx elements ...

  </PDF>



  <DocumentInformation

    source="out.pdf"

    result="out-docinfo.xml"

  />



</DDX>



You would then obtain the "out-docinfo.xml" document from the AssemblerResult object and use the docinfo.xsd schema, installed with LiveCycle, to obtain the content of the <NumPages> element.



Notes:

1) all documents returned by Assembler are of type idp.Document, even when they contain XML content.

2) the DDX Reference Guide contains a description of the DocInfo schema (Document Information Language).