create print preview sample code