1使用方法:GetPDFPageCount(string path)//path参数是pdf文件的路径
2/**//晴穹//
3
4 获取pdf文件的页数#region 获取pdf文件的页数
5 private int BytesLastIndexOf(Byte[] buffer, int length, string Search)
6 {
7 if (buffer == null)
8 return -1;
9 if (buffer.Length <= 0)
10 return -1;
11 byte[] SearchBytes = Encoding.Default.GetBytes(Search.ToUpper());
12 for (int i = length - SearchBytes.Length; i >= 0; i--)
13 {
14 bool bFound = true;
15 for (int j = 0; j < SearchBytes.Length; j++)
16 {
17 if (ByteUpper(buffer[i + j]) != SearchBytes[j])
18 {
19 bFound = false;
20
C#获取PDF文件的页数
最新推荐文章于 2024-04-21 10:46:52 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)