4 Replies Latest reply on Apr 15, 2015 8:41 AM by samakshb21144744

    Interface.AcroExch_PDDoc.GetJSObject.addAnnot.getProps/set Error: Unspecified error

    samakshb21144744

      Hi,

       

      I have this code for one of my projects. Kindly help me with this code. The quads property of the annotation would not get set.

       

       

      PDFApp = actxserver('AcroExch.App');

       

       

      PDFApp.Show();

       

      PDDoc = actxserver('AcroExch.PDDoc');

       

      pdDoc = actxserver('AcroExch.PDDoc');

       

      success = PDDoc.Open('');

       

      if success

       

        JSO = PDDoc.GetJSObject();

       

        pdDoc.Create()

       

        pdDoc.InsertPages(-1, PDDoc, 0, 1, 0)

       

       

       

       

      cord = [218;716;262;716;218;698;262;698];

         % Create an annotation object

       

        myAnnot = invoke(JSO, 'addAnnot');

       

         % Retrieve the annotation properties

       

        myAnnotProps = invoke(myAnnot, 'getProps');

       

        set(myAnnotProps, 'page', 0);

       

        set(myAnnotProps, 'type', 'Highlight');

       

        get(myAnnotProps,'quads', cord);

       

        set(myAnnotProps, 'opacity', '0.5');

       

        invoke(myAnnot, 'setProps', myAnnotProps);

       

      pdDoc.Save(1, '')

       

       

      Thanks,