Down2Pdf.jsp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%>
  2. <%@ page import="java.io.*" %>
  3. <%@ page import="com.ibleaders.ibsheet7.ibsheet.pdf.Down2Pdf" %>
  4. <%
  5. Down2Pdf ibPdf = new Down2Pdf(request, response);
  6. //====================================================================================================
  7. // [ 사용자 환경 설정 #1 ]
  8. //====================================================================================================
  9. // Html 페이지의 엔코딩이 utf-8 로 구성되어 있으면 "ibPdf.setPageEncoding("utf-8");" 로 설정하십시오.
  10. //====================================================================================================
  11. ibPdf.setPageEncoding("utf-8");
  12. //====================================================================================================
  13. // [ 사용자 환경 설정 #2 ]
  14. //====================================================================================================
  15. // ttf 파일이 위치한 폴더를 설정하십시오.
  16. //====================================================================================================
  17. ibPdf.setFontFolder("I:/down");
  18. try {
  19. ibPdf.down2pdf();
  20. } catch (Exception e) {
  21. out.println("<script>try{var targetWnd = null; if(opener!=null) {targetWnd = opener;} else {targetWnd = parent;} targetWnd.Grids[targetWnd.gTargetExcelSheetID].finishDownload(); targetWnd.Grids[targetWnd.gTargetExcelSheetID].ShowAlert('PDF 다운로드중 에러가 발생하였습니다.', 'U');}catch(e){}</script>");
  22. e.printStackTrace();
  23. } catch (Error e) {
  24. out.println("<script>try{var targetWnd = null; if(opener!=null) {targetWnd = opener;} else {targetWnd = parent;} targetWnd.Grids[targetWnd.gTargetExcelSheetID].finishDownload(); targetWnd.Grids[targetWnd.gTargetExcelSheetID].ShowAlert('PDF 다운로드중 에러가 발생하였습니다.', 'U');}catch(e){}</script>");
  25. e.printStackTrace();
  26. }
  27. %>