.. index:: 
  !MrzReader.readMrz Method
  
.. _id3_document_mrz_reader_read_mrz_class_method:

===============================================================================
MrzReader.readMrz Method
===============================================================================

Module: :ref:`MrzReader<id3_document_mrz_reader_class>`

Definition
----------

Detects and reads an MRZ in an image.


.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        read_mrz(self, image: DocumentImage) -> MrzReadingResult

      **Parameters**

        .. line-block::

          ``image`` :ref:`DocumentImage<id3_document_document_image_class>`
          :guilabel:`in` Source image to process


      **Returns**

        .. line-block::

          :ref:`MrzReadingResult<id3_document_mrz_reading_result_class>`
          MRZ reading output.

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        MrzReadingResult readMrz(DocumentImage image)

      **Parameters**

        .. line-block::

          ``image`` :ref:`DocumentImage<id3_document_document_image_class>`
          :guilabel:`in` Source image to process


      **Returns**

        .. line-block::

          :ref:`MrzReadingResult<id3_document_mrz_reading_result_class>`
          MRZ reading output.

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public MrzReadingResult ReadMrz(DocumentImage image)

      **Parameters**

        .. line-block::

          ``image`` :ref:`DocumentImage<id3_document_document_image_class>`
          :guilabel:`in` Source image to process


      **Returns**

        .. line-block::

          :ref:`MrzReadingResult<id3_document_mrz_reading_result_class>`
          MRZ reading output.

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public MrzReadingResult readMrz(DocumentImage image) throws DocumentException

      **Parameters**

        .. line-block::

          ``image`` :ref:`DocumentImage<id3_document_document_image_class>`
          :guilabel:`in` Source image to process


      **Returns**

        .. line-block::

          :ref:`MrzReadingResult<id3_document_mrz_reading_result_class>`
          MRZ reading output.

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public func readMrz(image: DocumentImage) throws -> MrzReadingResult

      **Parameters**

        .. line-block::

          ``image`` :ref:`DocumentImage<id3_document_document_image_class>`
          :guilabel:`in` Source image to process


      **Returns**

        .. line-block::

          :ref:`MrzReadingResult<id3_document_mrz_reading_result_class>`
          MRZ reading output.

      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: C
      :sync: C

      .. code:: C

        int id3DocumentMrzReader_ReadMrz (
            ID3_DOCUMENT_MRZ_READER hMrzReader, 
            ID3_DOCUMENT_IMAGE hImage, 
            ID3_DOCUMENT_MRZ_READING_RESULT hResult)

      **Parameters**

        .. line-block::

          ``hMrzReader`` :ref:`ID3_DOCUMENT_MRZ_READER<id3_document_mrz_reader_class>`
          :guilabel:`in` Handle to the MrzReader object.

          ``hImage`` :ref:`ID3_DOCUMENT_IMAGE<id3_document_document_image_class>`
          :guilabel:`in` Source image to process

          ``hResult`` :ref:`ID3_DOCUMENT_MRZ_READING_RESULT<id3_document_mrz_reading_result_class>`
          :guilabel:`out` MRZ reading output.


      **Returns**

        .. line-block::

          ``int``
          An error code.
          See :ref:`id3DocumentError<id3_document_document_error_enum>` file for the list of possible error codes.


