1
我想阅读我的PDF的所有网页,并将它们保存为图像,到目前为止,我所做的只是让我定义的网页0 = 1
第一等。有没有机会,我可以定义一个范围?阅读所有从PDF页面#
static void Main(string[] args)
{
try
{
string path = @"C:\Users\test\Desktop\pdfToWord\";
foreach (string file in Directory.EnumerateFiles(path, "*.pdf")) {
using (var document = PdfiumViewer.PdfDocument.Load(file))
{
int i = 1;
var image = document.Render(0,300,300, true);
image.Save(@"C:\Users\test\Desktop\pdfToWord\output.png", ImageFormat.Png);
}
}
}
catch (Exception ex)
{
// handle exception here;
}