I cannot replicate that easily, the only proof I have is in the database, it sometimes is recording the real names, sometimes the junk names for the same file.
Here is an example (attached pdf) of when it gives junk for names instead of the real field names:
- Code: Select all
var filename = @"C:\temp\test.pdf";
using (var file = File.OpenRead(filename))
{
var doc = new PdfDocument(file);
var form = doc.Form as PdfFormWidget;
if (form == null) throw new Exception("No form");
foreach (var field in form.FieldsWidget.List.Cast<PdfStyledFieldWidget>())
{
Console.WriteLine(field.Name);
}
}
Console.ReadKey();