|
@@ -255,7 +255,7 @@ public class GrapeCityController {
|
|
|
};
|
|
};
|
|
|
PdfSaveOptions pdfOptions = new PdfSaveOptions();
|
|
PdfSaveOptions pdfOptions = new PdfSaveOptions();
|
|
|
pdfOptions.setIncludeAutoMergedCells(true);
|
|
pdfOptions.setIncludeAutoMergedCells(true);
|
|
|
- pdfOptions.getShrinkToFitSettings().setCanShrinkToFitWrappedText(true);
|
|
|
|
|
|
|
+// pdfOptions.getShrinkToFitSettings().setCanShrinkToFitWrappedText(true);
|
|
|
List<PageInfo> pages = printManager.paginate(workbook);
|
|
List<PageInfo> pages = printManager.paginate(workbook);
|
|
|
printManager.savePageInfosToPDF(byteArrayOutputStream, pages, pdfOptions);
|
|
printManager.savePageInfosToPDF(byteArrayOutputStream, pages, pdfOptions);
|
|
|
return byteArrayOutputStream.toByteArray();
|
|
return byteArrayOutputStream.toByteArray();
|
|
@@ -282,6 +282,9 @@ public class GrapeCityController {
|
|
|
* 处理单元格背景图片
|
|
* 处理单元格背景图片
|
|
|
*/
|
|
*/
|
|
|
private void processCellBackgroundImages(IWorksheet worksheet, Map<String, byte[]> fileBytes) {
|
|
private void processCellBackgroundImages(IWorksheet worksheet, Map<String, byte[]> fileBytes) {
|
|
|
|
|
+ if (fileBytes == null || fileBytes.isEmpty()){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
for (int x = 0; x < worksheet.getRowCount(); x++) {
|
|
for (int x = 0; x < worksheet.getRowCount(); x++) {
|
|
|
for (int y = 0; y < worksheet.getColumnCount(); y++) {
|
|
for (int y = 0; y < worksheet.getColumnCount(); y++) {
|
|
|
IRange range = worksheet.getCells().get(x, y);
|
|
IRange range = worksheet.getCells().get(x, y);
|
|
@@ -329,6 +332,9 @@ public class GrapeCityController {
|
|
|
* 处理浮动图片
|
|
* 处理浮动图片
|
|
|
*/
|
|
*/
|
|
|
private void processFloatingImages(IWorksheet worksheet, Map<String, Object> data, Map<String, byte[]> fileBytes) {
|
|
private void processFloatingImages(IWorksheet worksheet, Map<String, Object> data, Map<String, byte[]> fileBytes) {
|
|
|
|
|
+ if (fileBytes == null || fileBytes.isEmpty()){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
Object illustrationObj = data.get("Illustration");
|
|
Object illustrationObj = data.get("Illustration");
|
|
|
if (illustrationObj != null) {
|
|
if (illustrationObj != null) {
|
|
|
JSONArray jsonArray;
|
|
JSONArray jsonArray;
|