Hi,
In the widget inherited from WidgetController you can use GetPage() method which will return the current page and you would be able to access it's fields (refer here for more info, works for both 12 and 12SP versions):
var page = GetPage();
var documentName = page.DocumentName;