The DataMapper already receives the Original FileName from Workflow. You can extract it to a field in your datamodel with the following JavaScript code:
automation.properties.OriginalFilename;
As for the number of pages, it is unfortunately not yet available, but it will be in the upcoming 1.3 release as another JS property named steps.totalPages.
Until then, you can create a datamodel field to which you assign the default value 0. When calling the DataMapper, that value will therefore be set to 0 for any file it processes. But once the “Execute Data Mapping” task completes, you can use a Workflow Script to count the number of pages in the PDF and store it into the proper field in the metadata retrieved from the data mapping task. For instance, assuming the field in your data model is named PageCount, then you’d use a script like the following in the workflow process:
set mypdf = Watch.GetPDFEditObject;
var myPdf =Watch.GetPDFEditObject();
myPdf.Open(Watch.GetJobFilename(), false);
var myMeta = new ActiveXObject("MetadataLib.MetaFile");
myMeta.LoadFromFile(Watch.GetMetadataFilename());
myMeta.Job().Group(0).Document(0).Fields.Add("_vger_fld_PageCount",myPdf.Pages().Count());
myMeta.SaveToFile(Watch.GetMetadataFilename());
myPdf.Close();
Then, when you perform the Content Creation task, you have to tick the “Update records from metadata” option to ensure the new value is stored back into the database.