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!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

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();

        }
    }



Empty