| | |
| | | import com.itextpdf.text.pdf.PdfPCell; |
| | | import com.itextpdf.text.pdf.PdfPTable; |
| | | import com.ltkj.hosp.domain.TjPdfVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | |
| | | * @Author: 西安路泰科技有限公司/lige |
| | | * @Date: 2022/12/8 9:31 |
| | | */ |
| | | @Slf4j |
| | | public class PdfUtils { |
| | | |
| | | /** |
| | | * 字体存放的跟路径,默认为'C:\Windows\Fonts\' |
| | | */ |
| | | private static final String FONT_PATH = System.getProperty("user.dir") + File.separator + "ltkj-admin"+File.separator+"src"+File.separator+"main"+File.separator+"resources"+File.separator+"Font"+File.separator; |
| | | // private static final String FONT_PATH = "C:\\Windows\\Fonts\\"; |
| | | // private static final String FONT_PATH = "/Users/chacca/开发相关/代码/ltkj_peis/ltkj-admin/src/main/resources/Font/"; |
| | | |
| | | /** |
| | |
| | | fontName = fontName + ",0"; |
| | | } |
| | | String font = FONT_PATH + fontName; |
| | | log.info("字体路径 -> {}",font); |
| | | return BaseFont.createFont(font, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); |
| | | } |
| | | |