Using scanner. Thx @xtao