Skip navigation
Alisa99
Currently Being Moderated

How do you programmatically "enable for commenting"?

Sep 17, 2009 9:53 AM

I have seen a million forum posts where people want to programmatically enable their pdfs for commenting, and the answer is: use LiveCycle.  We are considering buying LiveCycle for our server JUST for this purpose, since there doesn't seem to be any other way to do it.  Before we do, I want to know how it would work.  Since I don't have livecylce, I can't very well poke around and figure it out, and I don't see any free trial downloads.  Can anyone explain how you would go about this task?  On the other hand, isn't the pdf an open document standard?  Is there any way to modify the pdf "under the hood" to enable it for commenting, without using the Acrobat menu item?

 
Replies
  • Currently Being Moderated
    Sep 17, 2009 10:26 AM   in reply to Alisa99

    To answer the first part of your post - the trial version can be downloaded from Adobe's web site.  Have a look at:

     

    http://www.adobe.com/devnet/livecycle/trial/

     

    You'll want to take a look at the ReaderExtensions component.  There is a right that product can add to a document to allow commenting.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 17, 2009 11:49 AM   in reply to Alisa99

    If you have LiveCycle installed, you have the Reader Extensions service running.

     

    Now when you have a service running in LiveCycle, you can invoke it using several mechanisms. You can use a Java API, Email, Watched folder, Flex, Web service, etc.

     

    You can also build an orchestration (workflow) that calls multiple services.

     

    So it's really up to you as to how you want to invoke Reader Extension.

     

    You can also use the web interface to manually Reader extends the files one by one, or use Acrobat if your form is going to be used by less that 500 users (I believe).

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 17, 2009 11:58 AM   in reply to Alisa99

    "do you get an api with LiveCycle that is different than the one you get with Adobe Pro?"

    I don't think you get an public API form Acrobat. You do get an API when using the Reader Extension service in LiveCycle.

     

    "Can I automate that procedure by referencing the api in a .Net project?"

    You would most likely use the Web service interface to interact with Reader Extesion.

     

    See  the following links for more details:

     

    http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/0002 75.html

    http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/0004 14.html

     

    Jasmin

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 17, 2009 12:12 PM   in reply to Alisa99

    TO programmatically apply uage rights to a PDF document, see the topic named Applying Usage Rights to PDF Documents located at the following URL:

     

    http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/0004 11.html

     

    This will explain what to do and will lead you to the following Java code example:

     

    /*
     * This Java Quick Start uses the following JAR files
     * 1. adobe-reader-extensions-client.jar
     * 2. adobe-livecycle-client.jar
     * 3. adobe-usermanager-client.jar
     * 4. adobe-utilities.jar
     * 5. jbossall-client.jar (use a different JAR file if LiveCycle ES is not deployed
     * on JBoss)
     * 
     * These JAR files are located in the following path:
     * <install directory>/Adobe/LiveCycle8/LiveCycle_ES_SDK/client-libs
     * 
     * For complete details about the location of these JAR files, 
     * see "Including LiveCycle ES library files" in Programming
     * with LiveCycle ES
     */
    import com.adobe.livecycle.readerextensions.client.*;
    import java.util.*;
    import java.io.File;
    import java.io.FileInputStream;
    import com.adobe.idp.Document;
    import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
    import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;
     
    public class ApplyUsageRights{
     
         public static void main(String[] args) {
           try{
                            
                //Set connection properties required to invoke LiveCycle ES                                        
                Properties connectionProps = new Properties();
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "jnp://localhost:1099");
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_EJB_PROTOCOL);          
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
               
                //Create a ServiceClientFactory object
                ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
                
                //Create a ReaderExtensionsServiceClient object
                ReaderExtensionsServiceClient reClient = new ReaderExtensionsServiceClient(myFactory); 
               
                //Retrieve the PDF document to which to apply usage rights
                FileInputStream fileInputStream = new FileInputStream("C:\\Adobe\\Loan.pdf"); 
                Document inputPDF = new Document(fileInputStream);
                          
                //Create a UsageRight object and specify specific usage rights
                UsageRights useRight = new UsageRights(); 
                useRight.setEnabledDynamicFormFields(true);
                useRight.setEnabledComments(true);
                useRight.setEnabledFormFillIn(true);
                useRight.setEnabledDigitalSignatures(true);
               
                //Create a ReaderExtensionsOptions object
                ReaderExtensionsOptionSpec reOptions = new ReaderExtensionsOptionSpec(); 
                          
                //Set the usage rights 
                reOptions.setUsageRights(useRight); 
                reOptions.setMessage("This is a Rights-Enabled PDF Document");
               
                //Apply usage rights to a PDF document
                Document rightsEnabledPDF = reClient.applyUsageRights(
                     inputPDF,
                     "RE2",
                   null,
                   reOptions); 
               
                //Create a new PDF file that represents the rights-enabled PDF document
                File resultFile = new File("C:\\Adobe\\Critique5.pdf"); 
                rightsEnabledPDF.copyToFile(resultFile);
                                   
              }catch (Exception e) {
                    e.printStackTrace();
              }     
         }
    }
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 8, 2009 12:22 PM   in reply to smacdonald2008

    So, is there really no way to programmatically enable commenting on a PDF without installing the massive LiveCycle server software?  It seems to me a pretty simple thing i can open a PDF file in Adobe 8 and simply click the "enable commenting and reader" option and tada it is commenting enabled.  But i have been trying for quite a while now to find a way to perform this same functionality in code.  I looked into automating this process through Adobe Pro, but found the same result everywhere i looked and that was not possible.  Basically I am using itext to create PDFs and i want commenting to be enabled in reader for these PDFs, unfortunately i cannot perform this functionality with itext.

     

    It seems absurd for me to even investigate LiveCycle Reader Extensions when this is the only functionality i require and i have heard pricing estimates to be from 50K - 1M.  Although i have downloaded the trial, but now have to downgrade my version of Java to even install the trial.  I have already found the code above and it appears that it will do what i need, but it is just not fiasble for me to get LiveCycle for this simple task.  Any known solutions on how to peform this task in code?

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 8, 2009 12:50 PM   in reply to Alisa99

    Dang, yeah that is pretty ridiculous.  The more I deal with Adobe software the more i dislike it.  Unfortunately they have gained high popularity by offering their viewing software free of charge and asking for the firstborn child of anyone who wishes to use their tools and the second born when they realize even more tools are required to do something as simple as this.

     

    Thanks for the information though.  Looks like we will just not be able to allow commenting on the documents.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 13, 2012 4:16 AM   in reply to jarrodCook

    I am also searching for enable usage rights in order to comment, fill out form data. is there any other way to do this programatically with c++. 

     

    Jyothi

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 13, 2013 3:02 AM   in reply to interactivepdf

    Hi,

     

    As per End User License Agreeements there are some restrictions on distribution of PDF files that are Reader Extended using Acrobat.

     

    One has to use LiveCycle in case their requirement is to distribute Reader Extended files to more than 500 people.

     

    There seems to be a Lite version of Reader Extensions server for customers who do not want to install entire LiveCycle server product just for Reader Extensions , contact Adobe LiveCycle Enterprise sales/support team for more and accurate information on it

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 15, 2013 11:41 PM   in reply to N Santosh Kumar

    Mr.Santosh,

     

            we are creating pdfs with pdf operators, catalog , annots, fields, javascript etc. we are supporting till adobe 5.0, 6.0, and 7.0. To the updated versions inorder to support we need to extend it to XFA forms as acroform is not supporting in upper versions like 8.0, 9.0. when we tried with adobe live cycle files in that normal pdf page content they are not using pdf operators. need a sample file how to go with normal pdf page content and operators and for form need to go with xfa architecture. In XFA we need not write the whole page content in xml format right.

    can you put some more light on the above.

     

    Thanks.

     

    Regards

    c.siva jyothi

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2013 11:57 AM   in reply to interactivepdf

    Siva Jyothi,

     

     

    Can you be more specific about what you are looking for in AcroForms that are not supported in versions 8.0 & 9.0? and what exactly are you trying to achieve using XFA forms

     

     

    --Santosh

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 29, 2013 3:19 AM   in reply to N Santosh Kumar

    if we use xfa forms in our pdf then only our pdfs javascript will work in updated versions.

    Also export data to xml will work. for tagged pdf it needs to have structure of xfa inside pdf

    right.

    regards

    c.siva jyothi

     

     

    On Tue, 29 Jan 2013 01:27:39 +0530  wrote

     

     

     

     

          

               

               

               

        Re: How do you programmatically "enable for commenting"?

     

     

        created by N Santosh Kumar in LiveCycle Reader Extensions - View the full discussion

     

     

     

    Siva Jyothi,  Can you be more specific about what you are looking for in AcroForms that are

    not supported in versions 8.0 & 9.0? and what exactly are you trying to achieve using XFA

    forms  --Santosh

     

     

         Please note that the Adobe Forums do not accept email attachments. If you want to

    embed a screen image in your message please visit the thread in the forum to embed the image

    at http://forums.adobe.com/message/5028826#5028826

         Replies to this message go to everyone subscribed to this thread, not directly to the

    person who posted the message. To post a reply, either reply to this email or visit the

    message page: Re: How do you programmatically "enable for commenting"?

         To unsubscribe from this thread, please visit the message page at

    Re: How do you programmatically "enable for commenting"?. In the Actions box on the right, click the

    Stop Email Notifications link.

          

         Start a new discussion in LiveCycle Reader Extensions by email or at Adobe Community

      For more information about maintaining your forum email notifications please go to

    http://forums.adobe.com/message/2936746#2936746.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 30, 2013 5:48 PM   in reply to N Santosh Kumar

    the world will probably go nuts over this http://j.mp/UBcxbi

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 25, 2013 9:30 AM   in reply to Alisa99

    If you are using an Apple computer you can download an Automator service script that I made. It will enable you to select as many, or as few PDFs as you would like to enable comenting in and will automatically enable each PDF to "enable commenting". You can view the tutorial and download the Automator Script here:

     

    http://www.youtube.com/watch?v=azRq6vRSVbs

     

    Hope this helps.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points