Enabling Acrobat Shared Review using ColdFusion

The PDF annotations in Acrobat are impressive, but the implementation was much more suited to an Intranet rather than an Internet environment. In Acrobat 8, Adobe introduced a new type of online annotation for PDFs, called a ‘Shared Review’. In a shared review the information for configuring the annotation store is on the PDF itself, which makes it much more flexible and robust than previously.

Shared Reviews are normally initialed by a user from within Acrobat. The user follows a wizard, which adds some JavaScript to the PDF. To enable a Shared Review programmatically, needs a suitable library.

ColdFusion8 has a lot of new PDF related functionality provided by the new <cfpdf> tags. Adding JavaScript isn’t one of them. JavaScript can be added, however, by using the iText library, which is included in ColdFusion, presumably to help implement the CFDocument functionality.

The JavaScript that you need to insert into the PDF can be copiedĀ  from an existing PDF made using the manual approach, and then tweaked to suit your requirements.

Here is a snipped showing how to insert the JavaScript using the iText PdfStamper class.

<CFSCRIPT> 
    reader = CreateObject("java", "com.lowagie.text.pdf.PdfReader") 
	.init(expandPath("#ipFName#"); 
    opFile = CreateObject("java", "java.io.FileOutputStream") 
	.init(expandPath("#opFName#")); 
    stamper =CreateObject("java", "com.lowagie.text.pdf.PdfStamper") 
	.init(reader,opFile); 
    stamper.addJavascript(#jscript#); 
    stamper.close(); 
</CFSCRIPT>

5 Responses to “Enabling Acrobat Shared Review using ColdFusion”

  1. Can you please detail the javascript required for Shared Review. I would like embed in this functionality programatically. The idea is as follows

    1. Ask for the file to be reviewed from user.
    2. Use C# iTextSharp library to add the javascript in the pdf file and then send it for route.

    Do you think can this be done…..

  2. David Rutter says:

    If you follow the manual approach above, the javascript you need can be found in Acrobat under Advanced->DocumentProcessing->Document Javascripts. I haven’t tested iTextSharp; it claims to be a port of iText, so it should work.

  3. Aditya Marla says:

    Hi,
    Can u please have some time at my requirement and suggest me which one to use in Adobe LiveCycle ( I am new to this )

    I need to annotate PDF and display the PDF wth annotations and without annotations..

    What liveCycle should we use (Like Adobe LiveCycle Designer ES ??, OR Adobe LiveCycle Reader ??)

    Where to sore these annotations in a seperate FILE ?? If yes we can it be PDF ??

    Thanks and Regards

    Aditya Marla

  4. James says:

    Hi trying to implement something using the stamper.addJavaScript but keep getting told “The addJavaScript method was not found.”

    Any help would be appreciated

    Code below

    reader = createObject(“java”, “com.lowagie.text.pdf.PdfReader”).init(printPDFFile);
    fos = createObject(“java”, “java.io.FileOutputStream”).init(outputFile);
    stamper = createobject(“java”, “com.lowagie.text.pdf.PdfStamper”).init(reader, fos);
    stamper.addJavaScript(“this.print(false);”, false);
    stamper.close();

Leave a Reply