You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.3 KiB
45 lines
1.3 KiB
3 years ago
|
/*
|
||
|
* Copyright (C), 2018-2022
|
||
|
* Project: starter
|
||
|
* FileName: CustomPDFExporterCreator
|
||
|
* Author: xx
|
||
|
* Date: 2022/4/29 16:02
|
||
|
*/
|
||
|
package com.fr.plugin.hd.provider;
|
||
|
|
||
|
import com.fanruan.api.log.LogKit;
|
||
|
import com.fr.io.exporter.*;
|
||
|
import com.fr.plugin.hd.export.SheetPDFExporter;
|
||
|
import com.fr.stable.fun.Authorize;
|
||
|
|
||
|
import static com.fr.plugin.hd.LocaleFinder.PLUGIN_ID;
|
||
|
|
||
|
/**
|
||
|
* <Function Description><br>
|
||
|
* <CustomPDFExporterCreator>
|
||
|
*
|
||
|
* @author xx
|
||
|
* @since 1.0.0
|
||
|
*/
|
||
|
@Authorize(callSignKey = PLUGIN_ID)
|
||
|
public class CustomPDFExporterCreator extends AbstractPDFExporterCreator {
|
||
|
|
||
|
@Override
|
||
|
public PDFExporterProcessor createPDFExporter(boolean isPrint) {
|
||
|
LogKit.info("hd-CustomPDFExporterCreator-createPDFExporter-isPrint:{}", isPrint);
|
||
|
return isPrint ? new PDFExporterForPrint() : new SheetPDFExporter();
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public PDFExporterProcessor createPDFExporter(PDFExportType pdfExportType) {
|
||
|
LogKit.info("hd-CustomPDFExporterCreator-createPDFExporter-pdfExportType:{}", pdfExportType);
|
||
|
switch (pdfExportType) {
|
||
|
case EXPORT:
|
||
|
return new SheetPDFExporter();
|
||
|
case PRINT:
|
||
|
return new PDFExporterForPrint();
|
||
|
default:
|
||
|
return new PDFEmbExporter();
|
||
|
}
|
||
|
}
|
||
|
}
|