How to I retrieve the page number of a Form Field using Aspose PDF? I'm trying to recreate the PDF form in HTML by placing an image of each page and overlaying each field using the page number, coordinates, and dimensions.
Here's my current code:
public static List<PdfFieldDisplayModel> GetFieldPlacements(Stream stream)
{
var fields = new List<PdfFieldDisplayModel>();
var doc = new Document(stream);
var pdfForm = new Aspose.Pdf.Facades.Form(stream);
foreach (Field ff in doc.Form)
{
var txt = doc.Form[ff.Name] as TextBoxField;
var f = new PdfFieldDisplayModel();
f.PageNumber = ??????????????
f.Name = ff.Name;
f.PartialName = ff.PartialName;
f.Value = ff.Value;
f.Width = txt.Rect.Width;
f.Height = txt.Rect.Height;
f.Left = txt.Rect.LLX;
f.Bottom = txt.Rect.LLY;
fields.Add(f);
}
return fields;
}