Created
January 11, 2023 08:07
-
-
Save clxy/2e84b9c8f8406469563c31c1dd7e2195 to your computer and use it in GitHub Desktop.
Copy print configuration of sheet by POI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 印刷設定をコピーする | |
* TODO: 四つのTabのうち、シートTabが対応できてないみたい | |
* | |
* @deprecated 利用しない | |
*/ | |
@Deprecated | |
void copySheetPrintConfig(XSSFSheet from, XSSFSheet to) { | |
CTWorksheet fromCt = from.getCTWorksheet(); | |
CTWorksheet toCt = to.getCTWorksheet(); | |
// ページ設定 | |
toCt.setPageSetup(fromCt.getPageSetup()); // ページ | |
toCt.setPageMargins(fromCt.getPageMargins()); // 余白 | |
toCt.setPrintOptions(fromCt.getPrintOptions()); // 余白のページ中央 | |
toCt.setHeaderFooter(fromCt.getHeaderFooter()); // ヘッダー/フッター | |
toCt.setDimension(fromCt.getDimension()); // シートの印刷範囲 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment