出力PDFと画像の文字列の交差方法を指定
Contents
[
Hide
]
考えられる使用シナリオ
セルにテキストまたは文字列が含まれているが、セルの幅よりも大きい場合、次の列の次のセルが null または空の場合、文字列はオーバーフローします。 Excel ファイルを PDF/Image に保存すると、TextCrossType列挙。次の値があります。
-
TextCrossType.DEFAULT: MS Excel のような表示で、次のセルに依存します。次のセルが null の場合、文字列が交差するか、切り捨てられます。
-
TextCrossType。 CROSS_KEEP: MS Excel exporting PDF/Image のような文字列を表示します
-
TextCrossType.CROSS_OVERRIDE: 他のセルと交差してすべてのテキストを表示し、交差したセルのテキストを上書きします
-
TextCrossType.STRICT_IN_CELL: セルの幅内の文字列のみを表示します。
TextCrossType を使用して、出力 PDF/Image で文字列を交差させる方法を指定します
次のサンプル コードは、サンプルの Excel ファイルを読み込み、別のファイルを指定して PDF/Image 形式で保存します。TextCrossType.サンプルの Excel ファイルと出力ファイルは、次のリンクからダウンロードできます。
サンプルコード
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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// Load the template file | |
Workbook wb = new Workbook(srcDir + "sampleCrosssType.xlsx"); | |
// Initialize PDF save options | |
PdfSaveOptions saveOptions = new PdfSaveOptions(); | |
// Set text criss type | |
saveOptions.setTextCrossType(TextCrossType.STRICT_IN_CELL); | |
// Save output PDF file | |
wb.save(outDir + "outputCrosssType.pdf", saveOptions); |