This discussion is archived
2 Replies Latest reply: Nov 4, 2011 9:28 AM by 897019 RSS

Creating Markups programmatically when a document has more than one page

897019 Newbie
Currently Being Moderated
Hello All,

I am trying to create an application where a Text Markup has to be created programmatically and applied over the currently opened pdf document. I used the docs\AutoVueAPIProgrammersGuide.pdf & examples\AWTSample\AWTSample.java for reference. I was successful in creating the markup programmatically and applying it on pdf document when it had only one page. But when the document had more than one page my markup gets applied on the same page even after moving to the subsequent pages using vueBean.setPage(vueBean.getPage()+1);

By looking at the behavior of the VueBean it looks like the VueBean has reset the view to the next page but the control is still on the previous page. Is there anything else that i have to set other than the page number on the VueBean.

Thanks in advance,
Dwarka
  • 1. Re: Creating Markups programmatically when a document has more than one page
    ArtashesGamarian Explorer
    Currently Being Moderated
    You will need to set page on the spec.
    Create the spec (in this case TextBoxSpec), set the page on it (setPage()), then create entity using it.

    If you are creating markup entity using another method then please post your code snippet and we'll help you out with it.
  • 2. Re: Creating Markups programmatically when a document has more than one page
    897019 Newbie
    Currently Being Moderated
    Hello Artashes,

    Thank you very much for your quick response !!!

    I was able to get the desired results with your suggestion. I am posting my code below for the benifit of others with the same issue,

    *//Part of the code where i am creating the markup*
    m_vueBean.setMarkupModeEnabled(true);
    String text = buildPreStamp("101", 555, "2005-101", "Dummy User");
    PAN_CtlPoint ctlPt = new PAN_CtlPoint(10.00, 125.00);
    TextSpec spec = new TextSpec(m_vueBean.getMarkupBean().getMarkupEntitySpec(), ctlPt, text, TextBoxSpec.MRK_ALIGN_TOPLEFT, 0, 0);
    spec.setPage(m_vueBean.getPage());
    m_vueBean.getMarkupBean().setMarkupEntityClass(spec.getEntityClassName());
    m_vueBean.getMarkupBean().addMarkupEntity(spec);

    Regards,
    Dwarka

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points