Ported LRDOCS-387 to print document.