Welcome to the WinForms feedback portal. We’re happy you’re here! If you have feedback on how to improve the WinForms, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
Hi,
I am trying to flatten an XFA with a simple Console App, but result doesn't look too well:
Please see attached file. Code snippet:
class Program{static void Main(string[] args){var executingAssembly = new FileInfo((Assembly.GetExecutingAssembly().Location))?.Directory?.FullName;if (executingAssembly == null) return;var files = Directory.GetFiles(executingAssembly).ToList().Where(x => x.Split('.').Last() == "pdf");foreach (var file in files){var loadedDocument = new PdfLoadedXfaDocument(file);loadedDocument.Flatten = true;Console.WriteLine($"Flatten file: {file}");var ms = new MemoryStream();loadedDocument.Save(ms);loadedDocument.Close();File.WriteAllBytes(file,ms.ToArray());}Console.ReadKey();}}
