首页
友链
关于
免责声明
Search
1
王者营地战绩数据王者荣耀查询网页源码
6,255 阅读
2
群晖Active Backup for Business套件备份Linux服务器教程
4,387 阅读
3
影视分享
4,317 阅读
4
(亲测)Jrebel激活破解方式2019-08-21
4,293 阅读
5
centos7 安装及卸载 jekenis
3,576 阅读
日常
文章
后端
前端
Linux
异常
Flutter
分享
群辉
登录
Search
标签搜索
docker
springboot
Spring Boot
java
linux
Shiro
Graphics2D
图片
游戏账号交易
Mybatis
Spring Cloud
centos
脚本
Web Station
群辉
王者营地
战绩查询
平台对接
Spring Cloud Alibaba
nacos
绿林寻猫
累计撰写
249
篇文章
累计收到
26
条评论
首页
栏目
日常
文章
后端
前端
Linux
异常
Flutter
分享
群辉
页面
友链
关于
免责声明
搜索到
237
篇与
文章
的结果
2021-12-08
&和&&的区别
相同点:&和&&都可以用作逻辑与的运算符,表示逻辑与(and)。不同点:(1)&&具有短路的功能,而&不具备短路功能。(2)当&运算符两边的表达式的结果都为true时,整个运算结果才为true。而&&运算符第一个表达式为false时,则结果为false,不再计算第二个表达式。(3)&还可以用作位运算符,当&操作符两边的表达式不是boolean类型时,&表示按位与操作,我们通常使用0x0f来与一个整数进行&运算,来获取该整数的最低4个bit位,例如:0x31 & 0x0f的结果为0x01。
2021年12月08日
119 阅读
0 评论
0 点赞
2021-12-08
itext转换html成pdf(支持中文、图片)
1.首先导入依赖 <dependency> <groupId>com.itextpdf</groupId> <artifactId>itextpdf</artifactId> <version>5.5.11</version> </dependency> <dependency> <groupId>com.itextpdf</groupId> <artifactId>itext-asian</artifactId> <version>5.2.0</version> </dependency> <dependency> <groupId>org.xhtmlrenderer</groupId> <artifactId>flying-saucer-pdf</artifactId> <version>9.0.7</version> </dependency>2.代码部分package com.pdf.util; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.OutputStream; import org.jsoup.Jsoup; import org.xhtmlrenderer.pdf.ITextFontResolver; import org.xhtmlrenderer.pdf.ITextRenderer; import com.lowagie.text.pdf.BaseFont; /** * 转换html为pdf * @author Uncle Liu * */ public class Html2pdf { /** * 将HTML转成PD格式的文件。html文件的格式比较严格 * @param htmlFile * @param pdfFile * @throws Exception */ // <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> public static void html2pdf(String htmlFile, String pdfFile) throws Exception { // step 1 String url = new File(htmlFile).toURI().toURL().toString(); System.out.println(url); // step 2 OutputStream os = new FileOutputStream(pdfFile); ITextRenderer renderer = new ITextRenderer(); renderer.setDocument(url); // step 3 解决中文支持 ITextFontResolver fontResolver = renderer.getFontResolver(); if("linux".equals(getCurrentOperatingSystem())){ //Linux下的和Windows的不一样,要自己下载,不要拷贝Windows的到Linux fontResolver.addFont("/usr/share/fonts/chiness/simsun.ttc", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); }else{ fontResolver.addFont("C:\\Windows\\WinSxS\\amd64_microsoft-windows-font-truetype-simsun_31bf3856ad364e35_10.0.17134.1_none_e089ab61d8d9374e\\simsun.ttc", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); } renderer.layout(); renderer.createPDF(os); os.close(); System.out.println("create pdf done!!"); } public static String getCurrentOperatingSystem(){ String os = System.getProperty("os.name").toLowerCase(); System.out.println("---------当前操作系统是-----------" + os); return os; } public static void main(String[] args) { String htmlFile = "D:\\WorkSpace\\IdeaProjects\\pdf\\src\\main\\resources\\templates\\u.html"; String pdfFile = "c:/test.pdf"; try { Html2pdf.html2pdf(htmlFile, pdfFile); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } } 3.html页面注意:html格式非常严格,图片地址这里用的是绝对路径(file:///D:/WorkSpace/IdeaProjects/pdf/src/main/resources/static/images/1.jpg)如果是相对路径要在后台设置<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"/> <title>Title</title> <style> /*没有background-color生成的pdf一部分会是空白*/ body{ text-align:center;border: 0px;margin: 0px;background-color:#FFFFFF;} .div{ margin:0 auto; width:1188px; height:auto;} body { /*中文支持*/ font-family:SimSun; } </style> </head> <body> <div class="div"> <div> <h2>123我</h2> <img src="file:///D:/WorkSpace/IdeaProjects/pdf/src/main/resources/static/images/1.jpg" style="width: 20px;height: 20px"/> <table border="1" cellspacing="0"> <tr> <td>eE额33</td> <td>eE额33</td> </tr> <tr> <td>eE额33</td> <td>eE额33</td> </tr> <tr> <td>eE额33</td> <td>eE额33</td> </tr><tr> <td>eE额33</td> <td>eE额33</td> </tr> </table> </div> </div> </body> </html>4.生成pdf超出页面长度时会自动分页
2021年12月08日
131 阅读
0 评论
0 点赞
2021-12-08
mybatis 开启驼峰转换
在application.properties配置文件中添加#mybatis开启驼峰转换 mybatis.configuration.map-underscore-to-camel-case=true
2021年12月08日
68 阅读
0 评论
0 点赞
2021-12-08
To display the conditions report re-run your application with 'debug' enabled.
spring boot项目启动报错:To display the conditions report re-run your application with 'debug' enabled.Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.可能是因为配置了数据库的包,但是没有配置数据源的问题
2021年12月08日
217 阅读
0 评论
0 点赞
2021-12-08
itextpdf JAVA生成PDF文档
使用JAVA生成PDF的时候,还是有些注意事项需要处理的。第一、中文问题,默认的itext是不支持中文的,想要支持,需要做些处理。 1、直接引用操作系统的中文字体库支持,由于此方案限制性强,又绑定了操作系统,所以此处不做实现,有兴趣可在网上搜索看看。 2、引用itext-asian.jar包的字体支持,代码稍后上。 itext pdf引入中文常见异常: com.itextpdf.text.DocumentException: Font 'STSongStd-Light' with 'UniGB-UCS2-H' is not recognized. 解决方案:a、引入操作系统字体;2、将字体维护进jar包中,如果没有,直接找到字体放入对应jar包中,如果是路径错误,则更改包路径;3、通过itext-asian.jar来加载中文包。第二、表格中的设置,特别是上中下,左中右,不同的对象有不同的枚举实现,刚入手很容易混淆。其外是前景色,背景色,表格颜色等等。第三、输出图片,很容易报错。 itext pdf常见输出图片异常: An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem. 原因:PdfContentByte在addImage的时候需要在beginText()和endText()范围以外调用,否则生成的PDF就会报上述错误。使用的包: <dependency> <groupId>com.itextpdf</groupId> <artifactId>itextpdf</artifactId> <version>5.5.11</version> </dependency> <dependency> <groupId>com.itextpdf</groupId> <artifactId>itext-asian</artifactId> <version>5.2.0</version> </dependency>示例:package com.itext.test; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.Random; import com.itextpdf.text.BaseColor; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Element; import com.itextpdf.text.Font; import com.itextpdf.text.Image; import com.itextpdf.text.PageSize; import com.itextpdf.text.Paragraph; import com.itextpdf.text.Rectangle; import com.itextpdf.text.pdf.BarcodeQRCode; import com.itextpdf.text.pdf.BaseFont; import com.itextpdf.text.pdf.PdfContentByte; import com.itextpdf.text.pdf.PdfGState; import com.itextpdf.text.pdf.PdfPCell; import com.itextpdf.text.pdf.PdfPTable; import com.itextpdf.text.pdf.PdfPageEventHelper; import com.itextpdf.text.pdf.PdfWriter; public class D { private static String path = "docs/"; // 生成PDF后的存放路径 private static final String logoPath = "logo.png"; public static void main(String[] args) { // T t = new T(); initPDF(initData()); } /** * 初始化PDF * * @param apis */ public static void initPDF(List<Api> apis) { File folder = new File(path); if (!folder.exists()) folder.mkdirs(); // 创建目录 Document doc = null; try { // 中文字体,要有itext-asian.jar支持(默认的itext.jar是不支持中文的) BaseFont bfchinese = BaseFont.createFont("STSongStd-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); Rectangle pageSize = new Rectangle(PageSize.A4); // 页面大小设置为A4 doc = new Document(pageSize, 20, 20, 40, 40); // 创建doc对象并设置边距 PdfWriter writer = PdfWriter.getInstance(doc, new FileOutputStream(folder.getAbsolutePath() + File.separator + "API文档.pdf")); writer.setPageEvent(new SdkPdfPageEvent()); doc.open(); doc.addAuthor("Ares-xby"); doc.addSubject("SDK附属API文档"); doc.addTitle("API文档"); BaseColor borderColor = new BaseColor(90, 140, 200); BaseColor bgColor = new BaseColor(80, 130, 180); for (Api api : apis) { PdfPTable table = new PdfPTable({0.25f, 0.25f, 0.25f, 0.25f}); // table.setWidthPercentage(100); // 设置table宽度为100% // table.setHorizontalAlignment(PdfPTable.ALIGN_CENTER); // 设置table居中显示 for (int i = 0; i < api.getParams().size(); i++) { if (i == 0) { // row 1 table.addCell(createCell("API", bfchinese, borderColor, bgColor)); table.addCell(createCell(api.getApiName(), 12, bfchinese, 3, null, borderColor, bgColor)); // row 2 table.addCell(createCell("描述", bfchinese, borderColor)); table.addCell(createCell(api.getApiDesc(), 12, bfchinese, 3, null, borderColor)); } else { table.addCell(createCell(api.getParams().get(i).getParamName(), 10, bfchinese, null, Paragraph.ALIGN_RIGHT, borderColor)); table.addCell(createCell(api.getParams().get(i).getParamName(), 10, bfchinese, null, null, borderColor)); table.addCell(createCell(api.getParams().get(i).getParamType(), 10, bfchinese, null, null, borderColor)); table.addCell(createCell(api.getParams().get(i).getParamDesc(), 10, bfchinese, null, null, borderColor)); } } doc.add(table); } // 二维码 BarcodeQRCode qrcode = new BarcodeQRCode("http://www.baidu.com", 1, 1, null); Image qrcodeImage = qrcode.getImage(); qrcodeImage.setAbsolutePosition(10, 600); qrcodeImage.scalePercent(200); doc.add(qrcodeImage); doc.close(); System.out.println("init pdf over."); } catch (DocumentException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (doc != null) doc.close(); } } public static List<Api> initData() { List<Api> list = new ArrayList<Api>(); for (int i = 0; i < 100; i++) { Api api = new Api(); api.setApiName("api-" + i); api.setApiDesc("描述-" + i); int paramSize = new Random().nextInt(20); List<Params> paramList = new ArrayList<Params>(); for (int j = 0; j < paramSize; j++) { Params param = new Params(); param.setParamName("param-" + i + "-" + j); param.setParamType("paramType-" + i + "-" + j); param.setParamDesc("描述-" + i + "-" + j); paramList.add(param); } api.setParams(paramList); list.add(api); } System.out.println("init data over. size=" + list.size()); return list; } // 用於生成cell private static PdfPCell createCell(String text, BaseFont font, BaseColor borderColor) { return createCell(text, 12, font, null, null, borderColor, null); } // 用於生成cell private static PdfPCell createCell(String text, BaseFont font, BaseColor borderColor, BaseColor bgColor) { return createCell(text, 12, font, null, null, borderColor, bgColor); } // 用於生成cell private static PdfPCell createCell(String text, int fontsize, BaseFont font, Integer colspan, Integer align, BaseColor borderColor) { return createCell(text, fontsize, font, colspan, align, borderColor, null); } /** * 用於生成cell * @param text Cell文字内容 * @param fontsize 字体大小 * @param font 字体 * @param colspan 合并列数量 * @param align 显示位置(左中右,Paragraph对象) * @param borderColor Cell边框颜色 * @param bgColor Cell背景色 * @return */ private static PdfPCell createCell(String text, int fontsize, BaseFont font, Integer colspan, Integer align, BaseColor borderColor, BaseColor bgColor) { Paragraph pagragraph = new Paragraph(text, new Font(font, fontsize)); PdfPCell cell = new PdfPCell(pagragraph); cell.setFixedHeight(20); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 上中下,Element对象 if (align != null) cell.setHorizontalAlignment(align); if (colspan != null && colspan > 1) cell.setColspan(colspan); if (borderColor != null) cell.setBorderColor(borderColor); if (bgColor != null) cell.setBackgroundColor(bgColor); return cell; } /** * SDK中PDF相关的PageEvent */ static class SdkPdfPageEvent extends PdfPageEventHelper { @Override public void onStartPage(PdfWriter writer, Document document) { // 水印(water mark) PdfContentByte pcb = writer.getDirectContent(); pcb.saveState(); BaseFont bf; try { bf = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.EMBEDDED); pcb.setFontAndSize(bf, 36); } catch (DocumentException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } // 透明度设置 PdfGState gs = new PdfGState(); gs.setFillOpacity(0.2f); pcb.setGState(gs); pcb.beginText(); pcb.setTextMatrix(60, 90); pcb.showTextAligned(Element.ALIGN_LEFT, "XX公司有限公司", 200, 300, 45); pcb.endText(); pcb.restoreState(); } @Override public void onEndPage(PdfWriter writer, Document document) { // 页眉、页脚 PdfContentByte pcb = writer.getDirectContent(); try { pcb.setFontAndSize(BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.EMBEDDED), 10); } catch (Exception e) { e.printStackTrace(); } // 支持中文字体 pcb.saveState(); try { // pcb.addImage()方法要在pcb.beginText();pcb.endText();之外调用, // 否则生成的PDF打开时会报错: An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem. byte[] logoBytes = new byte[1000 * 1024]; // 此处数组大小要比logo图片大小要大, 否则图片会损坏;能够直接知道图片大小最好不过. InputStream logoIs = getClass().getResourceAsStream(logoPath); if(logoIs != null){ int logoSize = logoIs.read(logoBytes); // 尝试了一下,此处图片复制不完全,需要专门写个方法,将InputStream转换成Byte数组,详情参考org.apache.io.IOUtils.java的toByteArray(InputStream in)方法 if(logoSize > 0){ byte[] logo = new byte[logoSize]; System.arraycopy(logoBytes, 0, logo, 0, logoSize); Image image = Image.getInstance(logo);// 如果直接使用logoBytes,并且图片是jar包中的话,会报图片损坏异常;本地图片可直接getInstance时候使用路径。 image.setAbsolutePosition(document.left(), document.top(-5)); // 设置图片显示位置 image.scalePercent(12); // 按照百分比缩放 pcb.addImage(image); } }else System.err.println("logo input stream is null."); } catch (Exception e) { System.err.println(e); } pcb.beginText(); // Header float top = document.top(-15); pcb.showTextAligned(PdfContentByte.ALIGN_RIGHT, "XX开放平台API文档", document.right(), top, 0); // Footer float bottom = document.bottom(-15); pcb.showTextAligned(PdfContentByte.ALIGN_CENTER, "第 " + writer.getPageNumber() + " 页", (document.right() + document.left()) / 2, bottom, 0); pcb.endText(); pcb.restoreState(); pcb.closePath(); } } /** * POJO for init Data. */ static class Api { private String apiName; private String apiDesc; private List<Params> params; public String getApiName() { return apiName; } public void setApiName(String apiName) { this.apiName = apiName; } public String getApiDesc() { return apiDesc; } public void setApiDesc(String apiDesc) { this.apiDesc = apiDesc; } public List<Params> getParams() { return params; } public void setParams(List<Params> params) { this.params = params; } } /** * POJO for init Data. */ static class Params { private String paramName; private String paramType; private String paramDesc; public String getParamName() { return paramName; } public void setParamName(String paramName) { this.paramName = paramName; } public String getParamType() { return paramType; } public void setParamType(String paramType) { this.paramType = paramType; } public String getParamDesc() { return paramDesc; } public void setParamDesc(String paramDesc) { this.paramDesc = paramDesc; } } }注意:所需jar包(itext5.0以下的包路径是com.lowagie.text,与后续版本不一致,并且直接引用中文itext-asian.jar的时候会因为lowagie名称造成路径错误,导致中文引入失败):itext-5.0.2.jar, itext-asian-5.1.1.jar也可以是itextpdf-5.5.5.jar, itext-asian-5.2.0.jar(下载)(建议使用),注意搭配不要错误。搭配的依赖原则是itext.jar或者itextpdf.jar中com.itextpdf.text.pdf.CJKFont.java中load字体所用的路径, itext-asian-5.1.1.jar的路径是com/itextpdf/text/pdf/fonts/cjkfonts.properties,对应itext-5.0.2.jar中CJKFont的load路径; itext-asian-5.2.0.jar的路径是com/itextpdf/text/pdf/fonts/cmaps/cjk_registry.properties,对应itextpdf-5.5.5.jar中CJKFont的load路径。 最终效果:参照:https://www.cnblogs.com/icerainsoft/p/4900359.html
2021年12月08日
795 阅读
0 评论
0 点赞
2021-12-08
pdf在线预览打印
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>pdf浏览</title> <link href="PDFViewer/viewer.css" type="text/css" rel="stylesheet" /> <style type="text/css" media="screen"> html, body { height: 100%; } body { margin: 0; padding: 0; overflow: auto; } </style> <script type="text/JavaScript" src="style/js/jquery-1.6.2.min.js"></script> <link rel="resource" type="application/l10n" href="PDFViewer/locale/locale.properties" /> <script type="text/JavaScript" src="PDFViewer/l10n.js"></script> <script type="text/JavaScript" src="PDFViewer/pdf.js"></script> <script type="text/JavaScript" src="PDFViewer/debugger.js"></script> <script type="text/JavaScript" src="PDFViewer/viewer.js"></script> </head> <body class="dialog"> <div id="outerContainer" style="display: none;"> <div id="sidebarContainer"> <div id="toolbarSidebar"> <div class="splitToolbarButton toggled"> <button id="viewThumbnail" class="toolbarButton group toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="thumbs"> <span data-l10n-id="thumbs_label">Thumbnails</span> </button> <button id="viewOutline" class="toolbarButton group" title="Show Document Outline" tabindex="3" data-l10n-id="outline"> <span data-l10n-id="outline_label">Document Outline</span> </button> <button id="viewAttachments" class="toolbarButton group" title="Show Attachments" tabindex="4" data-l10n-id="attachments"> <span data-l10n-id="attachments_label">Attachments</span> </button> </div> </div> <div id="sidebarContent"> <div id="thumbnailView"></div> <div id="outlineView" class="hidden"></div> <div id="attachmentsView" class="hidden"></div> </div> </div> <!-- sidebarContainer --> <div id="mainContainer"> <div class="findbar hidden doorHanger hiddenSmallView" id="findbar"> <label for="findInput" class="toolbarLabel" data-l10n-id="find_label">Find:</label> <input id="findInput" class="toolbarField" tabindex="91"> <div class="splitToolbarButton"> <button class="toolbarButton findPrevious" title="" id="findPrevious" tabindex="92" data-l10n-id="find_previous"> <span data-l10n-id="find_previous_label">Previous</span> </button> <div class="splitToolbarButtonSeparator"></div> <button class="toolbarButton findNext" title="" id="findNext" tabindex="93" data-l10n-id="find_next"> <span data-l10n-id="find_next_label">Next</span> </button> </div> <input type="checkbox" id="findHighlightAll" class="toolbarField"> <label for="findHighlightAll" class="toolbarLabel" tabindex="94" data-l10n-id="find_highlight">Highlight all</label> <input type="checkbox" id="findMatchCase" class="toolbarField"> <label for="findMatchCase" class="toolbarLabel" tabindex="95" data-l10n-id="find_match_case_label">Match case</label> <span id="findMsg" class="toolbarLabel"></span> </div> <!-- findbar --> <div id="secondaryToolbar" class="secondaryToolbar hidden doorHangerRight"> <div id="secondaryToolbarButtonContainer"> <button id="secondaryPresentationMode" class="secondaryToolbarButton presentationMode visibleLargeView" title="Switch to Presentation Mode" tabindex="51" data-l10n-id="presentation_mode"> <span data-l10n-id="presentation_mode_label">Presentation Mode</span> </button> <button id="secondaryOpenFile" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="52" data-l10n-id="open_file"> <span data-l10n-id="open_file_label">Open</span> </button> <button id="secondaryPrint" class="secondaryToolbarButton print visibleMediumView" title="Print" tabindex="53" data-l10n-id="print"> <span data-l10n-id="print_label">Print</span> </button> <button id="secondaryDownload" class="secondaryToolbarButton download visibleMediumView" title="Download" tabindex="54" data-l10n-id="download"> <span data-l10n-id="download_label">Download</span> </button> <a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton bookmark visibleSmallView" title="Current view (copy or open in new window)" tabindex="55" data-l10n-id="bookmark"> <span data-l10n-id="bookmark_label">Current View</span> </a> <div class="horizontalToolbarSeparator visibleLargeView"></div> <button id="firstPage" class="secondaryToolbarButton firstPage" title="Go to First Page" tabindex="56" data-l10n-id="first_page"> <span data-l10n-id="first_page_label">Go to First Page</span> </button> <button id="lastPage" class="secondaryToolbarButton lastPage" title="Go to Last Page" tabindex="57" data-l10n-id="last_page"> <span data-l10n-id="last_page_label">Go to Last Page</span> </button> <div class="horizontalToolbarSeparator"></div> <button id="pageRotateCw" class="secondaryToolbarButton rotateCw" title="Rotate Clockwise" tabindex="58" data-l10n-id="page_rotate_cw"> <span data-l10n-id="page_rotate_cw_label">Rotate Clockwise</span> </button> <button id="pageRotateCcw" class="secondaryToolbarButton rotateCcw" title="Rotate Counterclockwise" tabindex="59" data-l10n-id="page_rotate_ccw"> <span data-l10n-id="page_rotate_ccw_label">Rotate Counterclockwise</span> </button> <div class="horizontalToolbarSeparator"></div> <button id="toggleHandTool" class="secondaryToolbarButton handTool" title="Enable hand tool" tabindex="60" data-l10n-id="hand_tool_enable"> <span data-l10n-id="hand_tool_enable_label">Enable hand tool</span> </button> <div class="horizontalToolbarSeparator"></div> <button id="documentProperties" class="secondaryToolbarButton documentProperties" title="Document Properties…" tabindex="61" data-l10n-id="document_properties"> <span data-l10n-id="document_properties_label">Document Properties…</span> </button> </div> </div> <!-- secondaryToolbar --> <div class="toolbar"> <div id="toolbarContainer"> <div id="toolbarViewer"> <div id="toolbarViewerLeft"> <button id="sidebarToggle" class="toolbarButton" title="Toggle Sidebar" tabindex="11" data-l10n-id="toggle_sidebar"> <span data-l10n-id="toggle_sidebar_label">Toggle Sidebar</span> </button> <div class="toolbarButtonSpacer"></div> <button id="viewFind" class="toolbarButton group hiddenSmallView" title="Find in Document" tabindex="12" data-l10n-id="findbar"> <span data-l10n-id="findbar_label">Find</span> </button> <div class="splitToolbarButton"> <button class="toolbarButton pageUp" title="Previous Page" id="previous" tabindex="13" data-l10n-id="previous"> <span data-l10n-id="previous_label">Previous</span> </button> <div class="splitToolbarButtonSeparator"></div> <button class="toolbarButton pageDown" title="Next Page" id="next" tabindex="14" data-l10n-id="next"> <span data-l10n-id="next_label">Next</span> </button> </div> <label id="pageNumberLabel" class="toolbarLabel" for="pageNumber" data-l10n-id="page_label">Page: </label> <input type="number" id="pageNumber" class="toolbarField pageNumber" value="1" size="4" min="1" tabindex="15"> <span id="numPages" class="toolbarLabel"></span> </div> <div id="toolbarViewerRight"> <button id="presentationMode" class="toolbarButton presentationMode hiddenLargeView" title="Switch to Presentation Mode" tabindex="31" data-l10n-id="presentation_mode"> <span data-l10n-id="presentation_mode_label">Presentation Mode</span> </button> <!-- <button id="openFile" class="toolbarButton openFile hiddenLargeView" title="Open File" tabindex="32" data-l10n-id="open_file"> <span data-l10n-id="open_file_label">Open</span> </button> --> <button id="print" class="toolbarButton print hiddenMediumView" title="Print" tabindex="33" data-l10n-id="print"> <span data-l10n-id="print_label">Print</span> </button> <button id="download" class="toolbarButton download hiddenMediumView" title="Download" tabindex="34" data-l10n-id="download"> <span data-l10n-id="download_label">Download</span> </button> <a href="#" id="viewBookmark" class="toolbarButton bookmark hiddenSmallView" title="Current view (copy or open in new window)" tabindex="35" data-l10n-id="bookmark"> <span data-l10n-id="bookmark_label">Current View</span> </a> <div class="verticalToolbarSeparator hiddenSmallView"></div> <button id="secondaryToolbarToggle" class="toolbarButton" title="Tools" tabindex="36" data-l10n-id="tools"> <span data-l10n-id="tools_label">Tools</span> </button> </div> <div class="outerCenter"> <div class="innerCenter" id="toolbarViewerMiddle"> <div class="splitToolbarButton"> <button id="zoomOut" class="toolbarButton zoomOut" title="Zoom Out" tabindex="21" data-l10n-id="zoom_out"> <span data-l10n-id="zoom_out_label">Zoom Out</span> </button> <div class="splitToolbarButtonSeparator"></div> <button id="zoomIn" class="toolbarButton zoomIn" title="Zoom In" tabindex="22" data-l10n-id="zoom_in"> <span data-l10n-id="zoom_in_label">Zoom In</span> </button> </div> <span id="scaleSelectContainer" class="dropdownToolbarButton"> <select id="scaleSelect" title="Zoom" tabindex="23" data-l10n-id="zoom"> <option id="pageAutoOption" title="" value="auto" selected="selected" data-l10n-id="page_scale_auto">Automatic Zoom</option> <option id="pageActualOption" title="" value="page-actual" data-l10n-id="page_scale_actual">Actual Size</option> <option id="pageFitOption" title="" value="page-fit" data-l10n-id="page_scale_fit">Fit Page</option> <option id="pageWidthOption" title="" value="page-width" data-l10n-id="page_scale_width">Full Width</option> <option id="customScaleOption" title="" value="custom"></option> <option title="" value="0.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 50 }'>50%</option> <option title="" value="0.75" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 75 }'>75%</option> <option title="" value="1" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 100 }'>100%</option> <option title="" value="1.25" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 125 }'>125%</option> <option title="" value="1.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 150 }'>150%</option> <option title="" value="2" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 200 }'>200%</option> <option title="" value="3" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 300 }'>300%</option> <option title="" value="4" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 400 }'>400%</option> </select> </span> </div> </div> </div> <div id="loadingBar"> <div class="progress"> <div class="glimmer"></div> </div> </div> </div> </div> <menu type="context" id="viewerContextMenu"> <menuitem id="contextFirstPage" label="First Page" data-l10n-id="first_page"></menuitem> <menuitem id="contextLastPage" label="Last Page" data-l10n-id="last_page"></menuitem> <menuitem id="contextPageRotateCw" label="Rotate Clockwise" data-l10n-id="page_rotate_cw"></menuitem> <menuitem id="contextPageRotateCcw" label="Rotate Counter-Clockwise" data-l10n-id="page_rotate_ccw"></menuitem> </menu> <div id="viewerContainer" tabindex="0" > <div id="viewer" class="pdfViewer"></div> </div> <div id="errorWrapper" hidden='true'> <div id="errorMessageLeft"> <span id="errorMessage"></span> <button id="errorShowMore" data-l10n-id="error_more_info"> More Information</button> <button id="errorShowLess" data-l10n-id="error_less_info" hidden='true'>Less Information</button> </div> <div id="errorMessageRight"> <button id="errorClose" data-l10n-id="error_close">Close</button> </div> <div class="clearBoth"></div> <textarea id="errorMoreInfo" hidden='true' readonly="readonly"></textarea> </div> </div> <!-- mainContainer --> <div id="overlayContainer" class="hidden"> <div id="passwordOverlay" class="container hidden"> <div class="dialog"> <div class="row"> <p id="passwordText" data-l10n-id="password_label">Enter the password to open this PDF file:</p> </div> <div class="row"> <input type="password" id="password" class="toolbarField" /> </div> <div class="buttonRow"> <button id="passwordCancel" class="overlayButton"> <span data-l10n-id="password_cancel">Cancel</span> </button> <button id="passwordSubmit" class="overlayButton"> <span data-l10n-id="password_ok">OK</span> </button> </div> </div> </div> <div id="documentPropertiesOverlay" class="container hidden"> <div class="dialog"> <div class="row"> <span data-l10n-id="document_properties_file_name">File name:</span> <p id="fileNameField">-</p> </div> <div class="row"> <span data-l10n-id="document_properties_file_size">File size:</span> <p id="fileSizeField">-</p> </div> <div class="separator"></div> <div class="row"> <span data-l10n-id="document_properties_title">Title:</span> <p id="titleField">-</p> </div> <div class="row"> <span data-l10n-id="document_properties_author">Author:</span> <p id="authorField">-</p> </div> <div class="row"> <span data-l10n-id="document_properties_subject">Subject:</span> <p id="subjectField">-</p> </div> <div class="row"> <span data-l10n-id="document_properties_keywords">Keywords:</span> <p id="keywordsField">-</p> </div> <div class="row"> <span data-l10n-id="document_properties_creation_date">Creation Date:</span> <p id="creationDateField">-</p> </div> <div class="row"> <span data-l10n-id="document_properties_modification_date">Modification Date:</span> <p id="modificationDateField">-</p> </div> <div class="row"> <span data-l10n-id="document_properties_creator">Creator:</span> <p id="creatorField">-</p> </div> <div class="separator"></div> <div class="row"> <span data-l10n-id="document_properties_producer">PDF Producer:</span> <p id="producerField">-</p> </div> <div class="row"> <span data-l10n-id="document_properties_version">PDF Version:</span> <p id="versionField">-</p> </div> <div class="row"> <span data-l10n-id="document_properties_page_count">Page Count:</span> <p id="pageCountField">-</p> </div> <div class="buttonRow"> <button id="documentPropertiesClose" class="overlayButton"> <span data-l10n-id="document_properties_close">Close</span> </button> </div> </div> </div> </div> <!-- overlayContainer --> </div><!-- outerContainer --> <div id="printContainer"></div> <div id="mozPrintCallback-shim" hidden> <style> @media print { #printContainer div { page-break-after: always; page-break-inside: avoid; } } </style> <style scoped> #mozPrintCallback-shim { position: fixed; top: 0; left: 0; height: 100%; width: 100%; z-index: 9999999; display: block; text-align: center; background-color: rgba(0, 0, 0, 0.5); } #mozPrintCallback-shim[hidden] { display: none; } @media print { #mozPrintCallback-shim { display: none; } } #mozPrintCallback-shim .mozPrintCallback-dialog-box { display: inline-block; margin: -50px auto 0; position: relative; top: 45%; left: 0; min-width: 220px; max-width: 400px; padding: 9px; border: 1px solid hsla(0, 0%, 0%, .5); border-radius: 2px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); background-color: #474747; color: hsl(0, 0%, 85%); font-size: 16px; line-height: 20px; } #mozPrintCallback-shim .progress-row { clear: both; padding: 1em 0; } #mozPrintCallback-shim progress { width: 100%; } #mozPrintCallback-shim .relative-progress { clear: both; float: right; } #mozPrintCallback-shim .progress-actions { clear: both; } </style> <div class="mozPrintCallback-dialog-box"> <!-- TODO: Localise the following strings --> Preparing document for printing... <div class="progress-row"> <progress value="0" max="100"></progress> <span class="relative-progress">0%</span> </div> <div class="progress-actions"> <input type="button" value="Cancel" class="mozPrintCallback-cancel"> </div> </div> </div><!-- PDF VIEWER END --> </body> <script> var maxtopHeight = parseInt(top.winHeight * 90 / 100) - 32; var maxtopWidth = parseInt(top.winWidth * 90 / 100) - 252; //$("#mainContainer").height(maxtopHeight); //setDialogScrollBar("mainContainer",maxtopHeight+20); var DEFAULT_URL = ""; showFlax(); function showFlax() { $("#outerContainer").show(); //存放在static文件夹下 DEFAULT_URL = "11.pdf"; document.addEventListener('DOMContentLoaded', webViewerLoad, true); document.getElementById('print').addEventListener('click',SecondaryToolbar.printClick.bind(SecondaryToolbar)); document.getElementById('download').addEventListener('click',SecondaryToolbar.downloadClick.bind(SecondaryToolbar)); } </script> </html> 下载地址:https://download.csdn.net/my
2021年12月08日
130 阅读
0 评论
0 点赞
2021-12-08
mybatis注解插入返回主键走过的坑
//keyProperty 放的是对象的属性,如果用@Param注解传递参,则要p.id选择属性,否则返回不了主键值 @Options(useGeneratedKeys = true,keyProperty = "p.id",keyColumn = "id") //@SelectKey注解也是一样 @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="p.id", before=false, resultType=Integer.class) int addProjectContract(@Param("p") ProjectContract projectContract); //两种注解选择一种就可以了拿值: int i = projectContractService.addProjectContract(p); System.out.println(i);//返回的是执行数 System.out.println(p.getId());//通过对象获取主键值
2021年12月08日
173 阅读
0 评论
0 点赞
2021-12-08
natapp外网穿透
1、下载客户端 2、安装natapp解压缩到目录D:\Program Files\natapp,双击打开会失败,需配置环境变量。3、注册账户,购买隧道 我的隧道:配置:4.运行复制authtoken, cmd进入natapp目录执行 natapp -authtoken 你的authtoken当然得启动本地项目,并配置80端口 至此就可以内网的服务器当成公网服务器来使用了
2021年12月08日
161 阅读
0 评论
0 点赞
2021-12-08
对象转JSON时属性丢失
在fastjson下将对象转json时会丢失部分属性的情况,出现这种情况的问题原因是由于属性命名不符合规范导致,比如:uId,一个字母后面紧跟着一个大写字母,导致反射get/set方法时会出现连续两个大写字母(getUId/setUId)。解决该问题的方法时在属性上加上注解:@JSONField(name="uId"),就可以解决该问题。或者是属性名serviceDeadline在get/set方法时方法名变成了getserviceDeadline/setserviceDeadline,改为getServiceDeadline/setServiceDeadline就可以了
2021年12月08日
203 阅读
0 评论
0 点赞
2021-12-08
Windows安装Zookeeper
zookeeper有单机、伪集群、集群三种部署方式,可根据自己对可靠性的需求选择合适的部署方式。下边是单机部署的介绍。1.下载安装进入下载目录,选择自己要下载的版本,这里以zookeeper-3.4.9为例下载地址:http://archive.apache.org/dist/zookeeper/ 2.配置2.1解压解压后的目录如下点击conf,把zoo_sample.cfg修改成zoo.cfg,必须是叫这个名称。 2.2修改zoo.cfg 2.3启动zookeeper服务在bin文件下的zkServer.cmd. 双击看到2181表示启动成功检查是否启动成功,cmd窗口运行jps至此Zookeeper单机版布置完成,搭建dubbo时先启动Zookeeper
2021年12月08日
166 阅读
0 评论
0 点赞
1
...
10
11
12
...
24