Port of ExtractPages task