技术标签: PDF C#基础 itextsharp
一、引用itextsharp库文件
下载链接为:https://download.csdn.net/download/xiaochenxihua/11014068
二、编写生成PDF的基础页面框架生成脚本
/***
* Title:"智慧工厂" 项目
* 主题:PDF基础设置
* Description:
* 功能:XXX
* Date:2018
* Version:1.2版本
* Author:Coffee
* Modify Recoder:
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using iTextSharp.text;
using iTextSharp.text.pdf;
namespace ITextSharpTest
{
public class PDFBase : PdfPageEventHelper
{
#region 属性
private String _fontFilePathForHeaderFooter = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "SIMHEI.TTF");
/// <summary>
/// 页眉/页脚所用的字体
/// </summary>
public String FontFilePathForHeaderFooter
{
get
{
return _fontFilePathForHeaderFooter;
}
set
{
_fontFilePathForHeaderFooter = value;
}
}
private String _fontFilePathForBody = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "SIMSUN.TTC,1");
/// <summary>
/// 正文内容所用的字体
/// </summary>
public String FontFilePathForBody
{
get { return _fontFilePathForBody; }
set { _fontFilePathForBody = value; }
}
private PdfPTable _header;
/// <summary>
/// 页眉
/// </summary>
public PdfPTable Header
{
get { return _header; }
private set { _header = value; }
}
private PdfPTable _footer;
/// <summary>
/// 页脚
/// </summary>
public PdfPTable Footer
{
get { return _footer; }
private set { _footer = value; }
}
private BaseFont _baseFontForHeaderFooter;
/// <summary>
/// 页眉页脚所用的字体
/// </summary>
public BaseFont BaseFontForHeaderFooter
{
get { return _baseFontForHeaderFooter; }
set { _baseFontForHeaderFooter = value; }
}
private BaseFont _baseFontForBody;
/// <summary>
/// 正文所用的字体
/// </summary>
public BaseFont BaseFontForBody
{
get { return _baseFontForBody; }
set { _baseFontForBody = value; }
}
private Document _document;
/// <summary>
/// PDF的Document
/// </summary>
public Document Document
{
get { return _document; }
private set { _document = value; }
}
#endregion
public override void OnOpenDocument(PdfWriter writer, Document document)
{
try
{
BaseFontForHeaderFooter = BaseFont.CreateFont(FontFilePathForHeaderFooter, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
BaseFontForBody = BaseFont.CreateFont(FontFilePathForBody, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
Document = document;
}
catch (DocumentException de)
{
throw de;
}
catch (System.IO.IOException ioe)
{
throw ioe;
}
}
#region 生成页头
/// <summary>
/// 生成页眉
/// </summary>
/// <param name="writer"></param>
/// <returns></returns>
public virtual PdfPTable GenerateHeader(iTextSharp.text.pdf.PdfWriter writer)
{
return null;
}
#endregion
#region 生成页脚
/// <summary>
/// 生成页脚
/// </summary>
/// <param name="writer"></param>
/// <returns></returns>
public virtual PdfPTable GenerateFooter(iTextSharp.text.pdf.PdfWriter writer)
{
return null;
}
#endregion
public override void OnEndPage(iTextSharp.text.pdf.PdfWriter writer, iTextSharp.text.Document document)
{
base.OnEndPage(writer, document);
//输出页眉
Header = GenerateHeader(writer);
Header.TotalWidth = document.PageSize.Width - 20f;
///调用PdfTable的WriteSelectedRows方法。该方法以第一个参数作为开始行写入。
///第二个参数-1表示没有结束行,并且包含所写的所有行。
///第三个参数和第四个参数是开始写入的坐标x和y.
Header.WriteSelectedRows(0, -1, 10, document.PageSize.Height - 20, writer.DirectContent);
//输出页脚
Footer = GenerateFooter(writer);
Footer.TotalWidth = document.PageSize.Width - 20f;
Footer.WriteSelectedRows(0, -1, 10, document.PageSize.GetBottom(50), writer.DirectContent);
}
}
}
三、测试生成PDF文件内容脚本
/***
* Title:"智慧工厂" 项目
* 主题:实现PDF文件的设置_关于交接班信息
* Description:
* 功能:XXX
* Date:2019
* Version:1.2版本
* Author:Coffee
* Modify Recoder:
*/
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using iTextSharp.text;
using iTextSharp.text.pdf;
using ITextSharpTest;
using kernal;
using Global;
namespace Control
{
public class Export_ChangeShifts_PDF : PDFBase
{
private static Export_ChangeShifts_PDF _Instance;//本类实例
/// <summary>
/// 本类实例
/// </summary>
/// <returns></returns>
public static Export_ChangeShifts_PDF GetInstance()
{
if (_Instance==null)
{
_Instance = new Export_ChangeShifts_PDF();
}
return _Instance;
}
#region 属性
private int _pageRowCount = 26; //每页展示的数据行数
private int _pageColCount = 4; //每页展示的列数
/// <summary>
/// 每页的数据行数
/// </summary>
public int PageRowCount
{
get { return _pageRowCount; }
set { _pageRowCount = value; }
}
/// <summary>
/// 每页展示的列数
/// </summary>
public int PageColCount
{
get
{
return _pageColCount;
}
set
{
_pageColCount = value;
}
}
#endregion
#region 需要导出为PDF的数据内容
/// <summary>
/// 导出为PDF文件的数据
/// </summary>
private DataTable _dtExportPDFDatas = null;
/// <summary>
/// 需要导出为PDF文件的数据集合
/// </summary>
/// <returns></returns>
private DataTable ExportPDFDatas()
{
DataTable dtAllInfoData = new DataTable();
dtAllInfoData.Columns.Add("Number"); //数据序号
dtAllInfoData.Columns.Add("OperaterName"); //操作者
dtAllInfoData.Columns.Add("HandoverTime"); //交接班时间
dtAllInfoData.Columns.Add("HandoverContents"); //交接班内容
DataRow row = null;
int TotalNumbers=0; //当前导出系统交接班信息的总数
List<Ctrl_View_System_OperationInfo_Data> _View_System_OperationInfo_Datas = new List<Ctrl_View_System_OperationInfo_Data>();//当前需要导出的系统交接班信息集合
TotalNumbers = Ctrl_CommonView_System_OperationInfoOperation.GetInstance().QueryView_System_OperationInfoTotalNumbers();//系统操作总数
_View_System_OperationInfo_Datas = Ctrl_CommonView_System_OperationInfoOperation.GetInstance().QueryAllView_System_OperationInfoOfIndex(0, TotalNumbers);
for (int i = 0; i < TotalNumbers; i++)
{
row = dtAllInfoData.NewRow();
row["Number"] = i+1;
row["OperaterName"] = _View_System_OperationInfo_Datas[i].OperaterName;
row["HandoverTime"] = _View_System_OperationInfo_Datas[i].HandoverTime;
row["HandoverContents"] = _View_System_OperationInfo_Datas[i].HandoverContents;
dtAllInfoData.Rows.Add(row);
}
return dtAllInfoData;
}
#endregion
#region 生成页眉
/// <summary>
/// 生成页眉
/// </summary>
/// <param name="writer">文件流</param>
/// <returns></returns>
public override PdfPTable GenerateHeader(iTextSharp.text.pdf.PdfWriter writer)
{
BaseFont baseFont = BaseFontForHeaderFooter;
iTextSharp.text.Font font_logo = new iTextSharp.text.Font(baseFont, 30, iTextSharp.text.Font.BOLD);
iTextSharp.text.Font font_header1 = new iTextSharp.text.Font(baseFont, 18, iTextSharp.text.Font.BOLD);
iTextSharp.text.Font font_header2 = new iTextSharp.text.Font(baseFont, 10, iTextSharp.text.Font.BOLD);
iTextSharp.text.Font font_headerContent = new iTextSharp.text.Font(baseFont, 8, iTextSharp.text.Font.NORMAL);
float[] widths = new float[] { 200,280,80,70, 50, 40,15,10,15 };
PdfPTable header = new PdfPTable(widths);
PdfPCell cell = new PdfPCell();
cell = GenerateOnlyBottomBorderCell(2, iTextSharp.text.Element.ALIGN_LEFT);
cell.Phrase = new Paragraph("测试XXX科技有限公司"+"\n"+"XXX型号设备", font_header2);
header.AddCell(cell);
cell = GenerateOnlyBottomBorderCell(2, iTextSharp.text.Element.ALIGN_CENTER);
cell.Phrase = new Paragraph("交接班信息记录", font_header1);
header.AddCell(cell);
cell = GenerateOnlyBottomBorderCell(2, iTextSharp.text.Element.ALIGN_RIGHT);
cell.Phrase = new Paragraph("导出日期:", font_header2);
header.AddCell(cell);
cell = GenerateOnlyBottomBorderCell(2, iTextSharp.text.Element.ALIGN_LEFT);
cell.Phrase = new Paragraph(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), font_headerContent);
header.AddCell(cell);
cell = GenerateOnlyBottomBorderCell(2, iTextSharp.text.Element.ALIGN_RIGHT);
cell.Phrase = new Paragraph("导出人员:", font_header2);
header.AddCell(cell);
cell = GenerateOnlyBottomBorderCell(2, iTextSharp.text.Element.ALIGN_CENTER);
cell.Phrase = new Paragraph(GlobalParaMgr.userName, font_headerContent);
header.AddCell(cell);
cell = GenerateOnlyBottomBorderCell(2, iTextSharp.text.Element.ALIGN_RIGHT);
cell.Phrase = new Paragraph("第", font_header2);
header.AddCell(cell);
cell = GenerateOnlyBottomBorderCell(2, iTextSharp.text.Element.ALIGN_CENTER);
cell.Phrase = new Paragraph(writer.PageNumber.ToString(), font_headerContent);
header.AddCell(cell);
cell = GenerateOnlyBottomBorderCell(2, iTextSharp.text.Element.ALIGN_RIGHT);
cell.Phrase = new Paragraph("页", font_header2);
header.AddCell(cell);
return header;
}
#region 生成只有底边的Cell
/// <summary>
/// 生成只有底边的cell
/// </summary>
/// <param name="bottomBorder"></param>
/// <param name="horizontalAlignment">水平对齐方式<see cref="iTextSharp.text.Element"/></param>
/// <returns></returns>
private PdfPCell GenerateOnlyBottomBorderCell(int bottomBorder,int horizontalAlignment)
{
PdfPCell cell = GenerateOnlyBottomBorderCell(bottomBorder, horizontalAlignment, iTextSharp.text.Element.ALIGN_BOTTOM);
cell.PaddingBottom = 5;
return cell;
}
/// <summary>
/// 生成只有底边的cell
/// </summary>
/// <param name="bottomBorder"></param>
/// <param name="horizontalAlignment">水平对齐方式<see cref="iTextSharp.text.Element"/></param>
/// <param name="verticalAlignment">垂直对齐方式<see cref="iTextSharp.text.Element"/</param>
/// <returns></returns>
private PdfPCell GenerateOnlyBottomBorderCell(int bottomBorder, int horizontalAlignment, int verticalAlignment)
{
PdfPCell cell = GenerateOnlyBottomBorderCell(bottomBorder);
cell.HorizontalAlignment = horizontalAlignment;
cell.VerticalAlignment = verticalAlignment; ;
return cell;
}
/// <summary>
/// 生成只有底边的cell
/// </summary>
/// <param name="bottomBorder"></param>
/// <returns></returns>
private PdfPCell GenerateOnlyBottomBorderCell(int bottomBorder)
{
PdfPCell cell = new PdfPCell();
cell.BorderWidthBottom = 2;
cell.BorderWidthLeft = 0;
cell.BorderWidthTop = 0;
cell.BorderWidthRight = 0;
return cell;
}
#endregion
#endregion
#region 生成页脚
public override PdfPTable GenerateFooter(iTextSharp.text.pdf.PdfWriter writer)
{
BaseFont baseFont = BaseFontForHeaderFooter;
iTextSharp.text.Font font = new iTextSharp.text.Font(baseFont, 10, iTextSharp.text.Font.NORMAL);
PdfPTable footer = new PdfPTable(3);
AddFooterCell(footer, "审阅:", font);
AddFooterCell(footer, "审批:", font);
AddFooterCell(footer, "日期:", font);
return footer;
}
private void AddFooterCell(PdfPTable foot, String text, iTextSharp.text.Font font)
{
PdfPCell cell = new PdfPCell();
cell.BorderWidthTop = 2;
cell.BorderWidthRight = 0;
cell.BorderWidthBottom = 0;
cell.BorderWidthLeft = 0;
cell.Phrase = new Phrase(text, font);
cell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER;
foot.AddCell(cell);
}
#endregion
#region 导出PDF
/// <summary>
/// 导出PDF
/// </summary>
/// <param name="path">导出路径</param>
public void ExportPDF(String path)
{
Export_ChangeShifts_PDF pdfReport = new Export_ChangeShifts_PDF();
Document document = new Document(PageSize.A4.Rotate(), -90, -90, 60, 10);//此处设置的偏移量是为了加大页面的可用范围,可以使用默认.
PdfWriter pdfWriter = PdfWriter.GetInstance(document, new FileStream(path, FileMode.Create, FileAccess.Write));
pdfWriter.PageEvent = pdfReport;//此处一定要赋值,才能触发页眉和页脚的处理
document.Open();
pdfReport.AddBody(document);
document.Close();
}
/// <summary>
/// 导出PDF
/// </summary>
/// <param name="path">导出路径</param>
public byte[] ExportPDF()
{
Export_ChangeShifts_PDF pdfReport = new Export_ChangeShifts_PDF();
Document document = new Document(PageSize.A4.Rotate(), -90, -90, 60, 10);//此处设置的偏移量是为了加大页面的可用范围,可以使用默认.
MemoryStream ms = new MemoryStream();
PdfWriter pdfWriter = PdfWriter.GetInstance(document, ms);
pdfWriter.PageEvent = pdfReport;//此处一定要赋值,才能触发页眉和页脚的处理
document.Open();
pdfReport.AddBody(document);
document.Close();
byte[] buff = ms.ToArray();
return buff;
}
#endregion
#region 添加内容
/// <summary>
/// 循环添加所有数据到每一页中
/// </summary>
/// <param name="document"></param>
private void AddBody(Document document)
{
_dtExportPDFDatas = ExportPDFDatas();
int count = (_dtExportPDFDatas.Rows.Count + (PageRowCount - 1)) / PageRowCount;
for (int i = 0; i < count; i++)
{
AddBodySinglePage(i + 1);
document.NewPage();
}
}
/// <summary>
/// 添加每页的数据信息
/// </summary>
/// <param name="pageNumber">页码</param>
private void AddBodySinglePage(int pageNumber)
{
BaseFont baseFont = BaseFontForBody;
iTextSharp.text.Font font_columnHeader = new iTextSharp.text.Font(baseFont, 11f, iTextSharp.text.Font.BOLD);
iTextSharp.text.Font font_contentNormal = new iTextSharp.text.Font(baseFont, 9.5f, iTextSharp.text.Font.NORMAL);
iTextSharp.text.Font font_contentSmall = new iTextSharp.text.Font(baseFont, 7f, iTextSharp.text.Font.NORMAL);
//此处是为了当列数很多时,便于循环生成所要的表格列宽比例
int columnCount = PageColCount;
float[] widths = new float[columnCount];
for (int i = 0; i < columnCount; i++)
{
if (i == 3)
{
widths[i] = 3F;
}
else
{
widths[i] = 0.7F;
}
}
PdfPTable bodyTable = new PdfPTable(widths);
bodyTable.SpacingBefore = 10;//与头部的距离
//添加表头
AddBodyHeader(bodyTable, font_columnHeader);
//添加对应每页的数据
AddSinglePageData(bodyTable, font_contentNormal, font_contentSmall, pageNumber);
Document.Add(bodyTable);
}
#region 添加内容标题
/// <summary>
/// 添加Body的列标题
/// </summary>
/// <param name="document"></param>
/// <param name="font_columnHeader"></param>
private void AddBodyHeader(PdfPTable bodyTable, iTextSharp.text.Font font_columnHeader)
{
//采用Rowspan和Colspan来控制单元格的合并与拆分,类似于HTML的Table.
AddColumnHeaderCell(bodyTable, "序号", font_columnHeader, 1, 2);
AddColumnHeaderCell(bodyTable, "操作者", font_columnHeader, 1, 2);
AddColumnHeaderCell(bodyTable, "交接班时间", font_columnHeader, 1, 2);
AddColumnHeaderCell(bodyTable, "交接班内容", font_columnHeader, 1, 2);
}
#endregion
#region 添加报表正文
/// <summary>
/// 添加对应每页的数据
/// </summary>
/// <param name="bodyTable">表格</param>
/// <param name="fontNormal">普通字体</param>
/// <param name="fontSmall">小字体,当内容显示不下,需要使用小字体来显示时,可以使用.</param>
/// <param name="pageNumber">页码</param>
private void AddSinglePageData(PdfPTable bodyTable,
iTextSharp.text.Font fontNormal,
iTextSharp.text.Font fontSmall, int pageNumber)
{
int count = _dtExportPDFDatas.Rows.Count;//数据总量
int startIndex = (pageNumber - 1) * PageRowCount;//开始索引
int endIndex = pageNumber * PageRowCount;//结束索引
int startIndex1 = count - startIndex;//下一页的开始索引
int surplusNumbers = count - endIndex;//剩下的数量
//Log.Write("pageNumber="+ pageNumber + " count=" + count+ " startIndex=" + startIndex+ " endIndex=" + endIndex+ " startIndex1=" + startIndex1+ " surplusNumbers=" + surplusNumbers);
if (surplusNumbers > PageRowCount)
{
for (int i = startIndex; i < endIndex; i++)
{
AddBodyContent(bodyTable, fontNormal, fontSmall, i);
}
}
else
{
if (surplusNumbers > 0)
{
for (int i = startIndex; i < endIndex; i++)
{
AddBodyContent(bodyTable, fontNormal, fontSmall, i);
}
}
else
{
for (int i = startIndex; i < startIndex + startIndex1; i++)
{
AddBodyContent(bodyTable, fontNormal, fontSmall, i);
}
}
}
}
/// <summary>
/// 添加报表正文
/// </summary>
/// <param name="bodyTable"></param>
/// <param name="fontNormal">普通字体</param>
/// <param name="fontSmall">小字体,当内容显示不下,需要使用小字体来显示时,可以使用.</param>
/// <param name="index">索引便于从数据库中按页拉取数据时使用.</param>
public void AddBodyContent(PdfPTable bodyTable,
iTextSharp.text.Font fontNormal,
iTextSharp.text.Font fontSmall,
int index)
{
DataRow row = _dtExportPDFDatas.Rows[index];
AddBodyContentCell(bodyTable, String.Format("{0}", row["Number"]), fontNormal); //数据序号
AddBodyContentCell(bodyTable, String.Format("{0}", row["OperaterName"]), fontNormal); //操作者
AddBodyContentCell(bodyTable, String.Format("{0}", row["HandoverTime"]), fontNormal); //交接班时间
AddBodyContentCell(bodyTable, String.Format("{0}", row["HandoverContents"]), fontNormal); //交接班内容
}
private static void AddBodyContentCell(PdfPTable bodyTable, String text, iTextSharp.text.Font font, int rowspan = 2, bool needRightBorder = true)
{
PdfPCell cell = new PdfPCell();
float defaultBorder = 0.5f;
cell.BorderWidthLeft = defaultBorder;
cell.BorderWidthTop = 0;
cell.BorderWidthRight = needRightBorder ? defaultBorder : 0;
cell.BorderWidthBottom = defaultBorder;
cell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER;
cell.VerticalAlignment = iTextSharp.text.Element.ALIGN_BASELINE;
cell.Rowspan = rowspan;
cell.PaddingBottom = 4;
cell.Phrase = new Phrase(text, font);
cell.FixedHeight = 18f;
bodyTable.AddCell(cell);
}
#endregion
#region 添加列标题单元格
/// <summary>
/// 添加列标题单元格
/// </summary>
/// <param name="table">表格行的单元格列表</param>
/// <param name="header">标题</param>
/// <param name="font">字段</param>
/// <param name="colspan">列空间</param>
/// <param name="rowspan">行空间</param>
/// <param name="needLeftBorder">是否需要左边框</param>
/// <param name="needRightBorder">是否需要右边框</param>
public void AddColumnHeaderCell(PdfPTable table,
String header,
iTextSharp.text.Font font,
int colspan,
int rowspan,
bool needLeftBorder = true,
bool needRightBorder = true)
{
PdfPCell cell = GenerateColumnHeaderCell(header, font, needLeftBorder, needRightBorder);
if (colspan >= 1)
{
cell.Colspan = colspan;
}
if (rowspan >= 1)
{
cell.Rowspan = rowspan;
}
table.AddCell(cell);
}
/// <summary>
/// 添加列标题单元格
/// </summary>
/// <param name="table">表格</param>
/// <param name="header">标题</param>
/// <param name="font">字段</param>
/// <param name="needLeftBorder">是否需要左边框</param>
/// <param name="needRightBorder">是否需要右边框</param>
public void AddColumnHeaderCell(PdfPTable table,
String header,
iTextSharp.text.Font font,
bool needLeftBorder = true,
bool needRightBorder = true)
{
PdfPCell cell = GenerateColumnHeaderCell(header, font, needLeftBorder, needRightBorder);
table.AddCell(cell);
}
#endregion
#region 生成列标题单元格
/// <summary>
/// 生成列标题单元格
/// </summary>
/// <param name="header">标题</param>
/// <param name="font">字段</param>
/// <param name="needLeftBorder">是否需要左边框</param>
/// <param name="needRightBorder">是否需要右边框</param>
/// <returns></returns>
private PdfPCell GenerateColumnHeaderCell(String header,
iTextSharp.text.Font font,
bool needLeftBorder = true,
bool needRightBorder = true)
{
PdfPCell cell = new PdfPCell();
float border = 0.5f;
cell.BorderWidthBottom = border;
if (needLeftBorder)
{
cell.BorderWidthLeft = border;
}
else
{
cell.BorderWidthLeft = 0;
}
cell.BorderWidthTop = border;
if (needRightBorder)
{
cell.BorderWidthRight = border;
}
else
{
cell.BorderWidthRight = 0;
}
cell.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER;
cell.VerticalAlignment = iTextSharp.text.Element.ALIGN_BASELINE;
cell.PaddingBottom = 4;
cell.Phrase = new Phrase(header, font);
return cell;
}
#endregion
#endregion
}//Class_end
}
调用导出PDF示例:
//导出对应的所有交接班信息PDF文件
Export_ChangeShifts_PDF.GetInstance().ExportPDF("C:\");
生成的PDF文件效果如下所示:
参考内容:https://download.csdn.net/download/xxdddail/8943371
文章浏览阅读423次。在这里先感谢帕兰映像,各位读者瞪大眼睛准备好哦,以下是原文: 我总是对每一个想学CSS的朋友说: “学CSS真的很简单,一个星期就搞定。” 但真的这么简单吗?魔方也很简单,拿到手里就知道怎么玩了,但最高境界却不是几天或几个月就能修成的,甚至根本就不可能达到,永远需要提高,看似痛苦,同时也享受升华的乐趣,CSS也一样,痛并快乐指的就是这些东西吧。 本文里面收集一些有关CSS的技巧、教程、工具和观点等_永远学不完的css
文章浏览阅读224次。据国家医保局最新消息,覆盖13.6亿参保人全国统一医保信息平台全面建成。实现医保业务编码标准统一、数据规范统一、经办服务统一,实现国家、省、市、县四级医保信息互联互通、数据有序共享,医保与多部门和医疗机构、药店等单位的信息共享。将在全国31个省份和新疆生产建设兵团全域上线,为参保人提供医保服务,医保信息化标准化取得里程碑式突破。随着医保信息平台的全面建成,越来越多的人主动或者被动的参与到了全民数字化的建设之中。人们也发现,当今数据的地位在不断的攀升,从一开始企业尝试利用数字化,到后来的企业重点建设数字化_bi決策分析 數位轉型的關鍵議題與挑戰
文章浏览阅读729次。这里需要注意poi的版本问题版本不同,代码不同,不过大同小异XSSFWorkbook和HSSFWorkbook 的样式上也有一定的区别先上两个常用的POI的pom依赖 <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.10_poi生成表格样式
文章浏览阅读442次。【IAR工程】STM8S208RB基于ST标准库下按键检测_stm8库开发的输入模式怎么检测
文章浏览阅读1k次。康耐视智能相机Insight与四轴,六轴工业机器人引导定位配合详细方法与步骤_康耐视的视觉引导项目集合
文章浏览阅读735次,点赞6次,收藏7次。在 Debian 系统的树莓派上使用 mDNS(Multicast DNS)广播其 IP 地址通常涉及到 Avahi 服务的使用。请注意,其他设备要能通过 mDNS 解析你的树莓派主机名,它们需要支持 mDNS 或者安装了相应的软件(如 Windows 下的 Bonjour 服务)。通过以上步骤,你的树莓派应该能够使用 mDNS 向局域网内的设备广播其 IP 地址和主机名了。你可以将其改为你想要的名称,然后保存并关闭文件。为你树莓派的主机名。如果解析成功,它应该能够返回树莓派的 IP 地址。_avahi怎么广播
文章浏览阅读158次。由于目标信号的发射时间未知,无源定位技术大多利用TDOA(到达时间差)进行目标定位.本文将求解GPS单点定位的Bancroft算法。_matlab 多点定位
文章浏览阅读336次,点赞9次,收藏8次。大家好,本文将围绕python高手修炼之道pdf下载展开说明,python高手之路 pdf百度云是一个很多人都想弄明白的事情,想搞清楚python高手到什么水平需要先了解以下几个事情。在 2017年LinuxIDC.com/4月/Python教程PDF合集下载/Python的UNIX和Linux系统管理指南.pdf。Python绝技运用Python成为顶级黑客.pdf。Python编程入门第3版高清扫描文字版.pdf。Python编程实战运用设计模式.pdf。Python袖珍指南第5版.pdf。
文章浏览阅读2.6k次。本堂茜 渡鸦区块链专栏记者 张杰拥有10多年的软件开发经验和创业经验,自称是“互联网老兵,区块链新秀”。随着互联网的发展,渐渐的他们不再满足于做线下的软件外包项目,更想在互联网方面做。 他们在互联网方面做了很多SAAS服务。例如为电信所做的大数据展示项目,通过大数据在大屏幕实时观测人口密度,如果一旦超过预警,部队警察便可以开始出动,采取进行相应疏导限流对策,以防止_区块链聊天 知乎
文章浏览阅读1.6k次。其实,华为技术不仅仅是聚焦运营商BG,还有企业BG、消费者BG(大家最熟悉的手机等终端业务)和公有云BU。关于华为技术如何,最近网上纷纷攘攘,各种说辞应有尽有。由于我对华为企业BG相对比较熟,所以只能站在企业角度,通过拿美国第三方咨询机构Gartner报告来谈谈,尽量通过第三方机构来证明,可能更具有说服力。简单说说Gartner象限,Gartner魔力四象限主要从执行力和技术前瞻性两个维度..._gartner 报告 权威吗
文章浏览阅读1.9w次,点赞9次,收藏48次。文献管理软件是学者或者作者用于记录、组织、调阅引用文献的计算机程序_mendeley
文章浏览阅读1k次。SpringBoot也是通过获取request的输入流来获取参数,这样上面的疑问就能解开了,为什么经过过滤器来到Controller请求参数就没了,这是因为 InputStream read方法内部有一个,postion,标志当前流读取到的位置,每读取一次,位置就会移动一次,如果读到最后,InputStream.read方法会返回-1,标志已经读取完了,如果想再次读取,可以调用inputstream.reset方法,position就会移动到上次调用mark的位置,mark默认是0,所以就能从头再读了。_spring 拦截处理请求参数