Java での PDF ページの回転
Contents
[
Hide
]
1 ページまたは複数ページの向きを変更する必要がある場合は、ページ回転 API を使用してください。
すべてのページを90度回転させる
文書内のすべてのページを時計回りに回転させる必要がある場合は、この例を使用してください。
public static void rotatePage(Path inputFile, Path outputFile) {
try (Document document = new Document(inputFile.toString())) {
for (Page page : document.getPages()) {
page.setRotate(Rotation.on90);
}
document.save(outputFile.toString());
}
}