Changing Document Settings and Annotations

This chapter describes how you can change the following settings and annotations on a document:

Bookmarks

The interface PageBookmarkable provides the functionality to add, get or remove bookmarks. For details on type PageBookmark, refer to the JavaDoc of org.eclipse.stardust.engine.extensions.dms.data.annotations.printdocument.PageBookmark.

Adding Bookmarks

Method

void addBookmark(PageBookmark bookmark);

adds a given bookmark to the document.

Retrieving Bookmarks

To get bookmarks of a document, you can either use the method

PageBookmark getBookmark(String id);

to retrieve a specific bookmark with a given id, or

Set<PageBookmark> getBookmarks();

to get all bookmarks as a set of bookmarks.

Retrieving the Default Bookmark

In case you like to get the default bookmark for a document, use the method:

PageBookmark getDefaultBookmark();

This returns the default bookmark of the document.

Moving Bookmarks

To move a bookmark, use the following method:

void moveBookmark(int sourceOrder, int targetOrder);

Hereby, the parameter sourceOrder determines the order to be replaced by the given targetOrder parameter.

Deleting Bookmarks

To remove a specific bookmark, use:

void removeBookmark(String id);

The bookmark with the given id is deleted.

Setting the Default Bookmark

To set the default bookmark, use:

void setDefaultBookmark(String id);

The bookmark with the given id is marked as default bookmark.

Notes

The interface org.eclipse.stardust.engine.extensions.dms.data.annotations.printdocument.NoteCapable provides methods for adding, retrieving and removing notes on a document. For details on type Note, refer to the JavaDoc of org.eclipse.stardust.engine.extensions.dms.data.annotations.printdocument.Note.

Adding Notes

To add a note, use the method:

void addNote(Note note);

Retrieving Notes

To get notes you can either use the method

Note getNote(String id);

to receive a note with a specific id, or

Set<Note> getNotes();

to get a set of all notes.

Deleting Notes

To delete a note with a specific id, use:

void removeNote(String id);

Highlights

The interface org.eclipse.stardust.engine.extensions.dms.data.annotations.printdocument.HighlightCapable provides methods for adding, retrieving and removing highlights on a document. For details on type Highlight, refer to the JavaDoc of org.eclipse.stardust.engine.extensions.dms.data.annotations.printdocument.Highlight.

Adding Highlights

To add a highlight to a document, use the method:

void addHighlight(Highlight highlight);

Retrieving Highlights

To get highlights set on a document, you can either use the method

Highlight getHighlight(String id);

to retrieve the highlight with a specific id, or

Set<Highlight> getHighlights();

to get all highlights set on a document.

Deleting Highlights

Use method

void removeHighlight(String id);

to remove a highlight with a specific id.

Stamps

The interface org.eclipse.stardust.engine.extensions.dms.data.annotations.printdocument.StampAware provides methods for adding, retrieving and removing stamps on a document. For details on type Stamp, refer to the JavaDoc of org.eclipse.stardust.engine.extensions.dms.data.annotations.printdocument.Stamp.

Adding Stamps

To add a stamp to a document, use the following method:

void addStamp(Stamp stamp);

Retrieving Stamps

To get a stamp added to a document, you can either use

Stamp getStamp(String id);

to receive a stamp with a specific id, or

Set<Stamp> getStamps();

to receive all stamps set on the document.

Deleting Stamps

Use

void removeStamp(String id);

to remove a stamp with a specific id.

Page Orientation

The interface org.eclipse.stardust.engine.extensions.dms.data.annotations.printdocument.PageOrientationAware provides methods for adding, retrieving and removing the page orientation of a document. For details on type PageOrientation, refer to the JavaDoc of org.eclipse.stardust.engine.extensions.dms.data.annotations.printdocument.PageOrientation.

Adding Page Orientation

To add a page orientation to a document, use the following method:

void addPageOrientation(PageOrientation pageOrientation);

Retrieving Page Orientation

To get page orientation that is set on a document, you can either use

PageOrientation getPageOrientation(int pageNumber);

to receive a page orientation with a specific page number, or

Set<PageOrientation> getPageOrientations();

to receive all page orientations set on the document.

Deleting Page Orientation

Use

void removePageOrientation(int pageNumber);

to remove a page orientation with a specific page number from the document.

Page Sequence

The interface org.eclipse.stardust.engine.extensions.dms.data.annotations.printdocument.PageSequenceAware provides methods for adding, getting and moving page sequences on a document.

Getting Page Sequence

To get a list with the sequence of pages of a document, use the following method:

List<Integer> getPageSequence();

Moving Page Sequence

You can move a single page in the page sequence by using method:

void movePage(int sourcePosition, int targetPosition);

Here, parameter sourcePosition determines the position of the page to move and targetPosition the position where it should be placed in the sequence.

To move several pages, use:

void movePages(int pageCount, int sourcePosition, int targetPosition);

Parameter pageCount determines the number of pages to move in the sequence from sourcePosition to targetPosition.

Setting Page Sequence

To set a list with Integer values determining the sequence of pages, use:

void setPageSequence(List<Integer> pageSequence);