Aspose.Words ドキュメントがあります。ドキュメントの各ページに TextBox Shape を挿入したいと考えています。
これは私の文書です:
// Aspose.Words document
Document document = new Document();
// The DocumentBuilder
DocumentBuilder builder = new DocumentBuilder(document);
builder.insertHtml("Here, there is a big String with a lot of HTML.");
これは私が最初のページでそれを行う方法です:
Shape textBox = new Shape(document, ShapeType.TEXT_BOX);
textBox.setWrapType(WrapType.SQUARE);
// Shape position
textBox.setDistanceTop(0);
textBox.setDistanceLeft(42);
// Shape dimensions
textBox.setWidth(200);
textBox.setHeight(20);
// ... other options useless here.
// Paragraph, content of the Shape
Paragraph paragraph = new Paragraph(document);
Run run = new Run(document);
run.setText("Here some text.");
paragraph.appendChild(run);
textBox.appendChild(paragraph);
// Now I insert my Shape on the first page.
builder.moveToDocumentStart();
builder.insertNode(textBox);
これは最初のページに最適です。
また、次のようにしてページ数を取得できることも知っています。
document.getPageCount();
ただし、すべてのページを移動する方法がわかりません。
助言がありますか?