From 3337dc4ea652ea1992a3218317fe0fb77581135f Mon Sep 17 00:00:00 2001 From: 20xd6 <20xd6@airmail.cc> Date: Wed, 31 Jul 2024 15:47:23 -0400 Subject: [PATCH] Add scratch file. --- scratch.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 scratch.cs diff --git a/scratch.cs b/scratch.cs new file mode 100644 index 0000000..e0d3df7 --- /dev/null +++ b/scratch.cs @@ -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()); + } + } +}