java.lang.Object | |
↳ | com.pspdfkit.api.DocumentEditor |
A class to perform editing operations on a document to export.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
enum | DocumentEditor.IndexPosition | The position to place the item relative to the index. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DocumentEditor()
Constructs a `DocumentEditor` with a blank document with 0 pages to work with.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addOperations(JSONArray jsonArray)
Form a custom operation from JSON and append to the operations to be performed.
| ||||||||||
void |
addPage(int pageIndex, DocumentEditor.IndexPosition indexPosition, int height, int width, Rotation rotation, Color color, Insets inset)
Add a single new page with the given configuration.
| ||||||||||
void |
clearPageLabels()
Clear labels from all of the pages.
| ||||||||||
void |
duplicatePages(Set<Integer> pageIndices)
Duplicate and insert after the referenced page indices.
| ||||||||||
void |
importDocument(int pageIndex, DocumentEditor.IndexPosition indexPosition, DataProvider documentProvider)
Import a document from another data source and insert into the document.
| ||||||||||
void |
keepPages(Set<Integer> pageIndices)
Keep all the pages referenced and remove the remaining.
| ||||||||||
void |
movePages(Set<Integer> pagesToMove, int moveToIndex, DocumentEditor.IndexPosition indexPosition)
Move the referenced pages to a new location.
| ||||||||||
void |
removePages(Set<Integer> pageIndices)
Remove the referenced pages.
| ||||||||||
void |
rotatePages(Set<Integer> pagesToRotate, Rotation rotation)
Rotate the reference pages by the rotation given.
| ||||||||||
void |
saveDocument(WritableDataProvider dataProvider)
Apply the staged operations and export to the given data provider.
| ||||||||||
void |
setPageLabel(Set<Integer> pageIndices, String label)
Set a label on the given pages.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Constructs a `DocumentEditor` with a blank document with 0 pages to work with.
Form a custom operation from JSON and append to the operations to be performed. For information on how to form an operation, please see https://pspdfkit.com/guides/web/current/features/document-editor/#operations.
jsonArray | An array of operations to perform. |
---|
Add a single new page with the given configuration.
pageIndex | The index in which to place the new page. |
---|---|
indexPosition | Place the page before or after the given page index. |
height | The height of the new page. |
width | The width of the new page. |
rotation | The rotation of the new page in 90 degree increments. |
color | The background color of the new page. |
inset | The edit insets for the new page. |
Clear labels from all of the pages.
Duplicate and insert after the referenced page indices.
pageIndices | The pages to duplicate. |
---|
Import a document from another data source and insert into the document.
pageIndex | The index to insert the document into. |
---|---|
indexPosition | Place the page before or after the given page index. |
documentProvider | The document to import. |
Keep all the pages referenced and remove the remaining.
pageIndices | Pages to keep. |
---|
Move the referenced pages to a new location.
pagesToMove | The pages to move. |
---|---|
moveToIndex | The index to move to. |
indexPosition | Move the pages before or after the given index. |
Remove the referenced pages.
pageIndices | All the pages to remove. |
---|
Rotate the reference pages by the rotation given.
pagesToRotate | The pages to rotate. |
---|---|
rotation | The rotation to apply in 90 degree increments. |
Apply the staged operations and export to the given data provider.
dataProvider | The data provider to export the document to. |
---|
Set a label on the given pages.
pageIndices | The pages to set the label. |
---|---|
label | The label to set. |