ver 6.0 object model - Adobe Acrobat

This is a discussion on ver 6.0 object model - Adobe Acrobat ; Hello, Thank you for a wonderful forum. After milling through, unfortunately I did not find anything in the CAcroPDPage class to expose the methods, properties, and events (as available) for the textbox object. I can manually add a textbox to ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

ver 6.0 object model

  1. Default ver 6.0 object model

    Hello,
    Thank you for a wonderful forum. After milling through, unfortunately I did not find anything in the CAcroPDPage class to expose the methods, properties, and events (as available) for the textbox object. I can manually add a textbox to a .pdf file but cannot locate the class detail to do it programmatically. Possibly this is done within the CAcroPDAnnot class but have had the same results.

    I'm trying to programmatically add text to a document before printing it. I'm working within vb6, xp/pro and acrobat 6.0.

    Possibly I must retrieve the javascript class object then manipulate but at this point it is speculation.

    Can anyone point me in the right direction?

    Many thanks in advance,
    Eric Abbott

  2. Default Re: ver 6.0 object model

    Have you read the IAC Reference? The properties and methods available
    are all documented there. I don't think there is anything on text
    boxes, however. Consider the VBJavaScript interface.

    Aandi Inston

  3. Default Re: ver 6.0 object model

    Aandi,
    Excerpt from the IAC Ref:
    AcroExch.PDPage
    ●AddAnnot — Adds a specified annotation at a specified location in the page’s annotation array.
    ●AddNewAnnot — Creates a new text annotation and adds it to the page.

    (I)did not locate a definitive definition (or code example) of either of these objects or parameters like the VB object browser lists:

    Function AddNewAnnot(nIndexAddAfter As Long, szSubType As String, rect As Object) As Object
    Member of Acrobat.CAcroPDPage
    Creates a new text annotation and adds it to the page.

    For example: what are the different subtypes?

    I will continue searching for additional documentation.

    Thank you for your assistance,
    Eric Abbott

  4. Default Re: ver 6.0 object model

    All:
    The API Reference does a better job of explaining the details behind the function. Researching it now for thread applicability.

    Regards,

    Eric

  5. Default Re: ver 6.0 object model

    Like a lot of PDF programming, to work effectively you need knowledge
    of the PDF format. Annotations are described in section 8.4 of the PDF
    Reference. Table 8.16 is particularly relevant.

    Aandi Inston

  6. Default Re: ver 6.0 object model

    Thanks Aandi,
    Thorough reference for the annotation objects but I don't believe this is the information concerning the text box tool. Still looking in the PDF reference document for that. The annotation type "freetext" isn't the correct object either I think. There's a lot of information here and sometimes the "list of contents" page is somewhat confusing to follow.

    I'll continue looking.

    Best regards,
    Eric Abbott

  7. Default Re: ver 6.0 object model

    The text box tool creates an annotation with subtype FreeText.

    Aandi Inston

  8. Default Re: ver 6.0 object model

    Hi Aandi,
    Thank you for the above instance information. I was wondering if the JSObject model is the same for version Acrobat 6.0 as it is for version 7.0?

    So far the following code gives me a graphic question mark instead of the freetext annotation (I think there needs to be some sort of repaint or re-set event to fire after creating the annotation):

    Public Sub main()
    'add a text annotation to the current page in Acrobat:
    'It will be added as the first annotation in the page's annotation array.

    Dim AcroApp As CAcroApp
    Dim AVDoc As CAcroAVDoc
    Dim AVPage As CAcroAVPageView
    Dim PDPage As CAcroPDPage
    Dim PDDoc As CAcroPDDoc
    Dim Rect As CAcroRect

    Dim LinkAnnot As CAcroPDAnnot
    Dim strAnnotValue As String
    Dim JSObject As Object
    Dim annot As Object
    Dim props As Object

    Set AcroApp = CreateObject("AcroExch.App")
    Set Rect = CreateObject("AcroExch.Rect")
    Set JSObject = CreateObject("acroexch.pddoc")

    Set AVDoc = AcroApp.GetActiveDoc
    Set PDDoc = AVDoc.GetPDDoc
    Set AVPage = AVDoc.GetAVPageView
    Set PDPage = PDDoc.AcquirePage(AVPage.GetPageNum)

    'set the location values
    Rect.Top = 745
    Rect.Left = 203
    Rect.Right = 382
    Rect.bottom = 712

    'retrieve the javascript object
    Set JSObject = PDDoc.GetJSObject

    'create a new text annnotation and assign text string value
    Set LinkAnnot = PDPage.AddNewAnnot(-1, "freetext", Rect)
    LinkAnnot.SetContents ("test")

    End Sub

  9. Default Re: ver 6.0 object model

    >Thank you for the above instance information. I was wondering if the JSObject model is the same for version Acrobat 6.0 as it is for version 7.0?

    The JSObject processing is the same, but JavaScript itself has quite a
    few changes. The JavaScript Reference, however, is reasonably good at
    noting the changes, and the versions where they occurred.

    > Set LinkAnnot = PDPage.AddNewAnnot(-1, "freetext", Rect)


    See the IAC Reference, this is not what the documentation says.

    Aandi Inston

  10. Default Re: ver 6.0 object model

    Aandi,
    You're right. The Reference says that the subtype is "FreeText".

    Thanks for the pointer. Have upgraded to 7.0. Still working the problem.

    eric

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. Using the object model from asp.net
    By Application Development in forum Sharepoint
    Replies: 5
    Last Post: 06-29-2006, 03:22 PM
  2. Tips on how to model this object?
    By Application Development in forum Graphics
    Replies: 3
    Last Post: 10-12-2005, 02:01 PM
  3. Object Model Problem
    By Application Development in forum basic.visual
    Replies: 6
    Last Post: 06-20-2005, 07:00 PM
  4. JS: Exploring the Object Model
    By Application Development in forum Adobe Indesign
    Replies: 0
    Last Post: 08-17-2004, 07:30 AM
  5. How to put an image onto a model object
    By Application Development in forum Graphics
    Replies: 3
    Last Post: 07-06-2004, 04:11 AM