Как изменить положение текстовой формы в OpenOffice API для Java?

Я пытаюсь использовать Nice Office Access (NOA) для встраивания OpenOffice Writer в мою программу OCR. Я могу добавить форму текста в документ, см. код ниже, но я не знаю, как изменить его положение. Кто-нибудь Помогите мне!

try {
    // Init office
    HashMap configuration = new HashMap();
    configuration.put(IOfficeApplication.APPLICATION_HOME_KEY, OPEN_OFFICE_ORG_PATH);
    configuration.put(IOfficeApplication.APPLICATION_TYPE_KEY, IOfficeApplication.LOCAL_APPLICATION);
    officeAplication = OfficeApplicationRuntime.getApplication(configuration);
    officeAplication.setConfiguration(configuration);
    officeAplication.activate();

    // Init frame and get service
    IFrame officeFrame = officeAplication.getDesktopService().constructNewOfficeFrame(panRight);
    IDocumentService documentService = officeAplication.getDocumentService();
    ITextDocument textDocument = (ITextDocument) documentService.constructNewDocument(officeFrame, IDocument.WRITER, DocumentDescriptor.DEFAULT);
    ITextService textService = textDocument.getTextService();
    ITextContentService textContentService = textService.getTextContentService();
    IText text = textService.getText();
    ITextCursorService textCursorService = text.getTextCursorService();
    ITextCursor textCursor = textCursorService.getTextCursor();

    // Insert text shape
    TextInfo textInfo = new TextInfo("Hello", VertOrientation.TOP, HoriOrientation.LEFT, 100, true, true, 100, true, true, 0xFFFFFF, TextContentAnchorType.AT_PAGE);
    ITextDocumentTextShape textDocumentTextShape = textContentService.constructNewTextShape(textInfo);
    textContentService.insertTextContent(textDocumentTextShape);

    XText xText = textDocumentTextShape.getXText();
    XTextRange xTextRange = xText.createTextCursor();
    XPropertySet xTextProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextRange);

    xTextProps.setPropertyValue("CharFontName", "Courier New");
    xTextProps.setPropertyValue("CharWeight", new Float(FontWeight.BOLD));
    xTextProps.setPropertyValue("CharPosture", FontSlant.ITALIC);
    xTextProps.setPropertyValue("CharHeight", new Float(28));
    xText.insertString(xText.getEnd(), "My First OpenOffice Document", true);

    // Now it is time to disable two commands in the frame
    officeFrame.disableDispatch(GlobalCommands.CLOSE_DOCUMENT);
    officeFrame.disableDispatch(GlobalCommands.QUIT_APPLICATION);
    officeFrame.updateDispatches();
} catch (Throwable throwable) {
    throwable.printStackTrace();
}

person Martin Leung    schedule 14.12.2014    source источник