1
私は自分のPDFのすべてのページを読んでイメージとして保存したいと考えています。今まで私が行っていることは、0 = 1
最初に定義されたページを取得しています。範囲を定義しますか?PDFからすべてのページを読むc#
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;
}