官方網頁
原始碼如下
using BitMiracle.LibTiff.Classic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Calculate_Tiff_page_with_BitMiracle.LibTiff.Net
{
class Program
{
static void Main(string[] args)
{
string path = @"C:\Users\owlin\Downloads\test.tif";
using (Tiff image = Tiff.Open(path, "r"))
{
Console.WriteLine(CalculatePageNumber(image));
Console.ReadLine();
}
}
private static int CalculatePageNumber(Tiff image)
{
int pageCount = 0;
do
{
++pageCount;
} while (image.ReadDirectory());
return pageCount;
}
}
}
沒有留言:
張貼留言