adding preview for printing function