Add scratch file.
This commit is contained in:
parent
1b386c0eca
commit
3337dc4ea6
28
scratch.cs
Normal file
28
scratch.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using QuestPDF.Fluent;
|
||||||
|
using QuestPDF.Infrastructure;
|
||||||
|
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
// Create a new PDF document
|
||||||
|
using (var stream = new MemoryStream())
|
||||||
|
{
|
||||||
|
var document = new Document(stream);
|
||||||
|
|
||||||
|
// Add each PDF document to the output document
|
||||||
|
for (int i = 1; i < args.Length; i++)
|
||||||
|
{
|
||||||
|
var inputDocument = new Document(new FileStream(args[i], FileMode.Open));
|
||||||
|
document.Append(inputDocument.GetContent());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save the output document
|
||||||
|
document.Save();
|
||||||
|
File.WriteAllBytes("merged.pdf", stream.ToArray());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user