Ich habe das sample code von Pdfsharp und das entsprechende Nuget-Package in Visual Studio verwendet.
http://forum.pdfsharp.net/viewtopic.php?f=2&t=832 welche Info soll ich daraus entnehmen?
code:
class Program
{
static void Main(string[] args)
{
// Get some file names
string[] files = GetFiles();
// Open the output document
PdfDocument outputDocument = new PdfDocument();
// Iterate files
foreach (string file in files)
{
// Open the document to import pages from it.
PdfDocument inputDocument = PdfReader.Open(file, PdfDocumentOpenMode.Import);
// Iterate pages
int count = inputDocument.PageCount;
for (int idx = 0; idx < count; idx++)
{
// Get the page from the external document...
PdfPage page = inputDocument.Pages[idx];
// ...and add it to the output document.
outputDocument.AddPage(page);
}
}
// Save the document...
const string filename = @"C:....";
outputDocument.Save(filename);
// ...and start a viewer.
//Process.Start(filename);
}
public static string[] GetFiles()
{
//hier umwandlung mit endpfad
DirectoryInfo di = new DirectoryInfo(@"C:...");
FileInfo[] files = di.GetFiles("*.pdf");
int i = 0;
string[] names = new string[files.Length];
foreach (var r in files)
{
names[i] = r.FullName;
i = i + 1;
}
return names;
}
}
}