> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cómo funciona Component Synchronizer

> Cómo el Component Synchronizer de ABBYY FineReader Engine conecta Visual Components (Image Viewer, Editor de texto, etc.) para que reaccionen a los eventos como si fueran una única aplicación de OCR en Windows.

<Warning>
  Visual Components están implementados en FRE para Windows.
</Warning>

[Component Synchronizer](/es/fine-reader/engine/visual-components-reference/supplementary-objects/componentsynchronizer) es un componente especial que implementa una respuesta automática a distintos eventos en los Visual Components. Puede conectar varios Visual Components al Synchronizer y funcionarán como una sola aplicación.

No es necesario usar Component Synchronizer con todo el conjunto de componentes conectados; conecte solo los que utilice. Por ejemplo, puede conectar únicamente [Image Viewer](/es/fine-reader/engine/visual-components-reference/imageviewer) mediante la propiedad ImageViewer y [Editor de texto](/es/fine-reader/engine/visual-components-reference/texteditor) mediante la propiedad TextEditor.

Component Synchronizer no tiene interfaz de usuario. No utiliza ninguna funcionalidad interna de los Visual Components; usa únicamente la API COM de los componentes. Component Synchronizer funciona como se describe a continuación."

<div id="when-a-component-is-connected-to-the-synchronizer-through-the-api">
  ## Cuando un componente se conecta a Component Synchronizer a través de la API
</div>

Si un componente u objeto se conecta a Component Synchronizer mediante:

<Accordion title="Propiedad ImageViewer">
  En este caso, la propiedad <strong>IComponentSynchronizer::ImageViewer</strong> se establece en el objeto <strong>ImageViewer</strong> especificado y, a continuación, se realizan las operaciones siguientes:

  <table>
    <thead>
      <tr>
        <th>La propiedad</th>
        <th>Se establece en</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <strong>IImageViewer::ZoomRectEnabled</strong>
        </td>

        <td>True</td>
      </tr>

      <tr>
        <td>
          <strong>IImageViewer::DocumentProcessingParams</strong>
        </td>

        <td>
          <strong>IComponentSynchronizer::DocumentProcessingParams</strong>
        </td>
      </tr>

      <tr>
        <td>
          <strong>IImageViewer::FRPage</strong>
        </td>

        <td>
          La página de <strong>IComponentSynchronizer::Document</strong> con el índice <strong>IComponentSynchronizer::PageIndex</strong>
        </td>
      </tr>
    </tbody>
  </table>
</Accordion>

<Accordion title="Propiedad ZoomViewer">
  En este caso, la propiedad <strong>IComponentSynchronizer::ZoomViewer</strong> se establece en el objeto <strong>ZoomViewer</strong> especificado y, a continuación, se realizan las operaciones siguientes:

  <table>
    <thead>
      <tr>
        <th>La propiedad</th>
        <th>Se establece en</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <strong>IZoomViewer::SymbolRectEnabled</strong>
        </td>

        <td>True</td>
      </tr>

      <tr>
        <td>
          <strong>IZoomViewer::DocumentProcessingParams</strong>
        </td>

        <td>
          <strong>IComponentSynchronizer::DocumentProcessingParams</strong>
        </td>
      </tr>

      <tr>
        <td>
          <strong>IZoomViewer::FRPage</strong>
        </td>

        <td>
          La página de <strong>IComponentSynchronizer::Document</strong> con el índice <strong>IComponentSynchronizer::PageIndex</strong>
        </td>
      </tr>
    </tbody>
  </table>
</Accordion>

<Accordion title="Propiedad TextEditor">
  En este caso, la propiedad <strong>IComponentSynchronizer::TextEditor</strong> se establece en el objeto <strong>TextEditor</strong> especificado y, a continuación, se realizan las operaciones siguientes:

  <table>
    <thead>
      <tr>
        <th>La propiedad</th>
        <th>Se establece en</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <strong>ITextEditor::SynthesisParamsForDocument</strong>
        </td>

        <td>
          El valor de la propiedad <strong>SynthesisParamsForDocument</strong> del objeto <strong>IComponentSynchronizer::DocumentProcessingParams</strong>
        </td>
      </tr>

      <tr>
        <td>
          <strong>ITextEditor::FRPage</strong>
        </td>

        <td>
          La página de <strong>IComponentSynchronizer::Document</strong> con el índice <strong>IComponentSynchronizer::PageIndex</strong>
        </td>
      </tr>
    </tbody>
  </table>
</Accordion>

<Accordion title="Propiedad TextValidator">
  En este caso, la propiedad <strong>IComponentSynchronizer::TextValidator</strong> se establece en el objeto <strong>TextValidator</strong> especificado y, a continuación, se realizan las operaciones siguientes:

  <table>
    <thead>
      <tr>
        <th>La propiedad</th>
        <th>Se establece en</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <strong>ITextValidator::SynthesisParamsForDocument</strong>
        </td>

        <td>
          El valor de la propiedad <strong>SynthesisParamsForDocument</strong> del objeto <strong>IComponentSynchronizer::DocumentProcessingParams</strong>
        </td>
      </tr>

      <tr>
        <td>
          <strong>ITextValidator::FRDocument</strong>
        </td>

        <td>
          <strong>IComponentSynchronizer::Document</strong>
        </td>
      </tr>
    </tbody>
  </table>
</Accordion>

<Accordion title="Propiedad DocumentViewer">
  En este caso, la propiedad IComponentSynchronizer::DocumentViewer se establece en el objeto <strong>DocumentViewer</strong> especificado y, a continuación, se realizan las siguientes operaciones:

  <table>
    <thead>
      <tr>
        <th>La propiedad</th>
        <th>Se establece en</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <strong>IDocumentViewer::FRDocument</strong>
        </td>

        <td>
          <strong>IComponentSynchronizer::Document</strong>
        </td>
      </tr>

      <tr>
        <td>
          <strong>IDocumentViewer::DocumentProcessingParams</strong>
        </td>

        <td>
          <strong>IComponentSynchronizer::DocumentProcessingParams</strong>
        </td>
      </tr>

      <tr>
        <td>
          <strong>IDocumentViewer::ActivePage</strong>
        </td>

        <td>
          La página de <strong>IComponentSynchronizer::Document</strong> correspondiente al índice <strong>IComponentSynchronizer::PageIndex</strong>
        </td>
      </tr>
    </tbody>
  </table>
</Accordion>

<Accordion title="Propiedad Document">
  En este caso, la propiedad <strong>IComponentSynchronizer::Document</strong> se establece en el objeto <strong>FRDocument</strong> especificado y, a continuación, se realizan las siguientes operaciones:

  <table>
    <thead>
      <tr>
        <th>La propiedad</th>
        <th>Se establece en</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <strong>IImageViewer::FRPage</strong>

          <br />

          <strong>IZoomViewer::FRPage</strong>

          <br />

          <strong>ITextEditor::FRPage</strong>

          <br />

          <strong>IDocumentViewer::ActivePage</strong>
        </td>

        <td>
          La primera página de <strong>IComponentSynchronizer::Document</strong>
        </td>
      </tr>

      <tr>
        <td>
          <strong>IComponentSynchronizer::PageIndex</strong>
        </td>

        <td>0</td>
      </tr>

      <tr>
        <td>
          <strong>IDocumentViewer::FRDocument</strong>

          <br />

          <strong>ITextValidator::FRDocument</strong>
        </td>

        <td>
          <strong>IComponentSynchronizer::Document</strong>
        </td>
      </tr>
    </tbody>
  </table>
</Accordion>

<Accordion title="Propiedad DocumentProcessingParams">
  En este caso, la propiedad <strong>IComponentSynchronizer::DocumentProcessingParams</strong> se establece en el objeto <strong>DocumentProcessingParams</strong> especificado y, a continuación, se realizan las siguientes operaciones:

  <table>
    <thead>
      <tr>
        <th>La propiedad</th>
        <th>Se establece en</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <strong>IImageViewer::DocumentProcessingParams</strong>

          <br />

          <strong>IZoomViewer::DocumentProcessingParams</strong>

          <br />

          <strong>IDocumentViewer::DocumentProcessingParams</strong>
        </td>

        <td>
          <strong>IComponentSynchronizer::DocumentProcessingParams</strong>
        </td>
      </tr>

      <tr>
        <td>
          <strong>ITextEditor::SynthesisParamsForDocument</strong> <br />
          <strong>ITextValidator::SynthesisParamsForDocument</strong>
        </td>

        <td>
          El valor de la propiedad <strong>SynthesisParamsForDocument</strong> del objeto <strong>IComponentSynchronizer::DocumentProcessingParams</strong>
        </td>
      </tr>
    </tbody>
  </table>
</Accordion>

<Accordion title="Propiedad PageIndex">
  En este caso, la propiedad <strong>IComponentSynchronizer::PageIndex</strong> se establece en el valor especificado y, a continuación, se realizan las siguientes operaciones:

  <table>
    <thead>
      <tr>
        <th>La propiedad</th>
        <th>Se establece en</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <strong>IImageViewer::FRPage</strong>

          <br />

          <strong>IZoomViewer::FRPage</strong>

          <br />

          <strong>ITextEditor::FRPage</strong>

          <br />

          <strong>IDocumentViewer::ActivePage</strong>
        </td>

        <td>
          La página de <strong>IComponentSynchronizer::Document</strong> correspondiente al índice <strong>IComponentSynchronizer::PageIndex</strong>
        </td>
      </tr>
    </tbody>
  </table>
</Accordion>

<div id="when-a-connected-component-generates-an-event">
  ## Cuando un componente conectado genera un evento
</div>

Eventos del Image Viewer conectado:

<Accordion title="Evento OnMouseButtonUp">
  Si el Image Viewer genera el evento [OnMouseButtonUp](/es/fine-reader/engine/visual-components-reference/iinputevents/onmousebuttonup-method), Component Synchronizer realiza las siguientes operaciones:

  ```
  if( mouseButton == MBU_LeftButton && ZoomViewer != 0 ) {
   int documentX = 0;
   int documentY = 0;
   ImageViewer->ScreenToDocument( x, y, &documentX, &documentY );
   ZoomViewer->CenterOnDocumentPoint( documentX, documentY );
  }
  ```
</Accordion>

<Accordion title="Evento OnBlockSelectionChanged">
  Si el Image Viewer genera el evento [OnBlockSelectionChanged](/es/fine-reader/engine/visual-components-reference/iimageviewerevents/onblockselectionchanged-method), Component Synchronizer realiza las siguientes operaciones:

  ```
  if( selected == VARIANT_TRUE ) {
   if( textEditor != 0 ) {
    textEditor->ShowBlock( blockIndex, NotFound );
   }
  }
  ```
</Accordion>

<Accordion title="Evento OnTableSelected">
  Si el Image Viewer genera el evento [OnTableCellsSelected](/es/fine-reader/engine/visual-components-reference/iimageviewerevents/ontablecellsselected-method), Component Synchronizer llama al método [ShowBlock](/es/fine-reader/engine/visual-components-reference/texteditor/showblock-method) del objeto [TextEditor](/es/fine-reader/engine/visual-components-reference/texteditor) con el índice del bloque seleccionado y el índice de la celda situada en la esquina inferior derecha.
</Accordion>

<Accordion title="Evento OnAfterDblClick">
  Si el Image Viewer genera el evento [OnAfterDblClick](/es/fine-reader/engine/visual-components-reference/iimageviewerevents/onafterdblclick-method), Component Synchronizer realiza las siguientes operaciones:

  ```
  if( textEditor != 0 ) {
   textEditor->ActivateOn( blockIndex, x, y );
  }
  ```
</Accordion>

<Accordion title="Evento OnActivePageChanged">
  Si el Image Viewer genera el evento [OnActivePageChanged](/es/fine-reader/engine/visual-components-reference/iimageviewerevents/onactivepagechanged-method) y las propiedades ZoomViewer, TextEditor y DocumentViewer del objeto ComponentSynchronizer ya se han establecido, la propiedad FRPage o ActivePage del componente correspondiente se establece en la página especificada del documento.
</Accordion>

<Accordion title="Evento OnSelectTool">
  Si el Image Viewer genera el evento [OnSelectTool](/es/fine-reader/engine/visual-components-reference/iimageviewerevents/onselecttool-method), Component Synchronizer realiza las siguientes operaciones:

  ```
  if( ZoomViewer == 0 ) {
   return;
  }
  IFRPagePtr curPage;
  ZoomViewer->get_FRPage( &curPage );
  if( curPage != 0 ) {
   ZoomViewer->put_ActiveTool( selectedTool );
  }
  ```
</Accordion>

<Accordion title="Evento OnOptionsChanged">
  Si el Image Viewer genera el evento [OnOptionsChanged](/es/fine-reader/engine/visual-components-reference/iimageviewerevents/onoptionschanged-method) y las propiedades ZoomViewer, DocumentViewer, TextEditor y TextValidator del objeto ComponentSynchronizer ya se han establecido, se llama al método UpdateOptions de los objetos ZoomViewer, DocumentViewer, TextEditor y TextValidator.
</Accordion>

Eventos del Zoom Viewer conectado:

<Accordion title="Evento OnVisibleDocumentAreaChanged">
  Si el Zoom Viewer genera el evento [OnVisibleDocumentAreaChange](/es/fine-reader/engine/visual-components-reference/izoomviewerevents/onvisibledocumentareachange-method), Component Synchronizer realiza las siguientes operaciones:

  ```
  if( ImageViewer != 0 ) {
   ImageViewer->put_ZoomRect( visibleRect );
   if( isInFocus ) {
    ImageViewer->ShowDocumentArea( visibleRect );
   }
  }
  ```
</Accordion>

<Accordion title="Evento OnBlockSelectionChanged">
  Si el Zoom Viewer genera el evento [OnBlockSelectionChanged](/es/fine-reader/engine/visual-components-reference/izoomviewerevents/onblockselectionchanged-method), Component Synchronizer realiza las siguientes operaciones:

  ```
  if( selected == VARIANT_TRUE ) {
   if( textEditor != 0 ) {
    textEditor->ShowBlock( blockIndex, NotFound );
   }
  }
  ```
</Accordion>

<Accordion title="Evento OnTableCellsSelected">
  Si el Zoom Viewer genera el evento [OnTableCellsSelected](/es/fine-reader/engine/visual-components-reference/izoomviewerevents/ontablecellsselected-method), Component Synchronizer llama al método ShowBlock del objeto TextEditor con el índice del bloque seleccionado y el índice de la celda situada en la esquina inferior derecha.
</Accordion>

<Accordion title="Evento OnAfterDblClick">
  Si Zoom Viewer genera el evento [OnAfterDblClick](/es/fine-reader/engine/visual-components-reference/iimageviewerevents/onafterdblclick-method), Component Synchronizer realiza las siguientes operaciones:

  ```
  if( textEditor != 0 ) {
   textEditor->ActivateOn( blockIndex, x, y );
  }
  ```
</Accordion>

<Accordion title="Evento OnActivePageChanged">
  Si Zoom Viewer genera el evento [OnActivePageChanged](/es/fine-reader/engine/visual-components-reference/izoomviewerevents/onactivepagechanged-method) y las propiedades ImageViewer, TextEditor y DocumentViewer del objeto ComponentSynchronizer ya se han establecido, la propiedad FRPage o ActivePage del componente correspondiente se establece en la página especificada del documento.
</Accordion>

<Accordion title="Evento OnSelectTool">
  Si Zoom Viewer genera el evento [OnSelectTool](/es/fine-reader/engine/visual-components-reference/izoomviewerevents/onselecttool-method), Component Synchronizer realiza las siguientes operaciones:

  ```
  if( ImageViewer == 0 ) {
   return;
  }
  IFRPagePtr curPage;
  ImageViewer->get_FRPage( &curPage );
  if( curPage != 0 ) {
   ImageViewer->put_ActiveTool( selectedTool );
  }
  ```
</Accordion>

<Accordion title="Evento OnOptionsChanged">
  Si Zoom Viewer genera el evento [OnOptionsChanged](/es/fine-reader/engine/visual-components-reference/izoomviewerevents/onoptionschanged-method) y las propiedades ImageViewer, DocumentViewer, TextEditor y TextValidator del objeto ComponentSynchronizer ya se han establecido, se llama al método UpdateOptions de los objetos ImageViewer, DocumentViewer, TextEditor y TextValidator.
</Accordion>

Eventos del Document Viewer conectado:

<Accordion title="Evento OnActivePageChanged">
  Si Document Viewer genera el evento [OnActivePageChanged](/es/fine-reader/engine/visual-components-reference/idocumentviewerevents/onactivepagechanged-method) y las propiedades ImageViewer, ZoomViewer y TextEditor del objeto ComponentSynchronizer ya se han establecido, la propiedad FRPage del componente correspondiente se establece en la página especificada del documento.
</Accordion>

<Accordion title="Evento OnDocumentChanged">
  Si Document Viewer genera el evento [OnDocumentChanged](/es/fine-reader/engine/visual-components-reference/idocumentviewerevents/ondocumentchanged-method) y las propiedades ImageViewer, ZoomViewer, TextEditor y TextValidator del objeto ComponentSynchronizer ya se han establecido:

  * la propiedad FRDocument del objeto TextValidator se establece en el nuevo documento
  * la propiedad FRPage de los objetos ImageViewer, ZoomViewer y TextEditor, y la propiedad ActivePage del objeto DocumentViewer, se establecen en la primera página del nuevo documento
</Accordion>

<Accordion title="Evento OnOptionsChanged">
  Si Document Viewer genera el evento [OnOptionsChanged](/es/fine-reader/engine/visual-components-reference/idocumentviewerevents/onoptionschanged-method) y las propiedades ImageViewer, ZoomViewer, TextEditor y TextValidator del objeto ComponentSynchronizer ya se han establecido, se llama al método UpdateOptions de los objetos ImageViewer, ZoomViewer, TextEditor y TextValidator.
</Accordion>

Eventos del Editor de texto conectado:

<Accordion title="Evento OnEditorBlockChanged">
  Si el Editor de texto genera el evento [OnEditorBlockChanged](/es/fine-reader/engine/visual-components-reference/itexteditorevents/oneditorblockchanged-method), ComponentSynchronizer realiza las siguientes operaciones:

  1. Si las propiedades ImageViewer y ZoomViewer del objeto ComponentSynchronizer ya se han establecido, se llama al método SetSelectedBlocksIndices de los objetos ImageViewer y ZoomViewer para el bloque especificado.
  2. Si se trata de un bloque de la tabla, se llama al método SetSelectedCells de los objetos ImageViewer y ZoomViewer para la celda seleccionada.
  3. A continuación, se llama al método ShowDocumentArea de los objetos ImageViewer y ZoomViewer.
</Accordion>

<Accordion title="Evento OnSymbolSelected">
  Si el Editor de texto genera el evento [OnSymbolSelected](/es/fine-reader/engine/visual-components-reference/itexteditorevents/onsymbolselected-method), Component Synchronizer realiza las siguientes operaciones:

  ```
  if( ZoomViewer != 0 ) {
   ZoomViewer->put_SymbolRect( symbolRect );
  }
  if( ImageViewer != 0 ) {
   ImageViewer->ShowDocumentArea( symbolRect );
  }
  if( ZoomViewer != 0 ) {
   ZoomViewer->ShowDocumentArea( symbolRect );
  }
  ```
</Accordion>

<Accordion title="Evento OnActivePageChanged">
  Si el Editor de texto genera el evento [OnActivePageChanged](/es/fine-reader/engine/visual-components-reference/itexteditorevents/onactivepagechanged-method) y las propiedades ImageViewer, ZoomViewer y DocumentViewer del objeto ComponentSynchronizer ya se han configurado, la propiedad FRPage o ActivePage del componente correspondiente se establece en la página especificada del documento.
</Accordion>

<Accordion title="Evento OnOptionsChanged">
  Si el Editor de texto genera el evento [OnOptionsChanged](/es/fine-reader/engine/visual-components-reference/itexteditorevents/onoptionschanged-method) y las propiedades ImageViewer, ZoomViewer, DocumentViewer y TextValidator del objeto ComponentSynchronizer ya se han configurado, se llama al método UpdateOptions de los objetos ImageViewer, ZoomViewer, DocumentViewer y TextValidator.
</Accordion>

Eventos del Text Validator conectado:

<Accordion title="Evento OnSymbolSelected">
  Si Text Validator genera el evento [OnSymbolSelected](/es/fine-reader/engine/visual-components-reference/itextvalidatorevents/onsymbolselected-method), Component Synchronizer realiza las siguientes operaciones:

  ```
  if( ZoomViewer != 0 ) {
   ZoomViewer->put_SymbolRect( symbolRectangle );
  }
  ```
</Accordion>

<Accordion title="Evento OnSelectionChanged">
  Si Text Validator genera el evento [OnSelectionChanged](/es/fine-reader/engine/visual-components-reference/itextvalidatorevents/onselectionchanged-method), Component Synchronizer realiza las siguientes operaciones:

  ```
  int symbolPos;
  IEditorPosition* nextPosition;
  position->get_Symbol( &symbolPos );
  nextPosition->put_Symbol( symbolPos + length );
  if( textEditor != 0 ) {
   textEditor->SetSelection( position, nextPosition );
  }
  ```
</Accordion>

<Accordion title="Evento OnActivePageChanged">
  Si Text Validator genera el evento [OnActivePageChanged](/es/fine-reader/engine/visual-components-reference/itextvalidatorevents/onactivepagechanged-method) y las propiedades ImageViewer, ZoomViewer, TextEditor y DocumentViewer del objeto ComponentSynchronizer ya se han configurado, la propiedad FRPage o ActivePage del componente correspondiente se establece en la página especificada del documento.
</Accordion>

<Accordion title="Evento OnDocumentChanged">
  Si Text Validator genera el evento [OnDocumentChanged](/es/fine-reader/engine/visual-components-reference/itextvalidatorevents/ondocumentchanged-method) y las propiedades ImageViewer, ZoomViewer, TextEditor y DocumentViewer del objeto ComponentSynchronizer ya se han configurado:

  * la propiedad FRDocument del objeto DocumentViewer se establece en el nuevo documento
  * las propiedades FRPage de los objetos ImageViewer, ZoomViewer y TextEditor, y la propiedad ActivePage del objeto DocumentViewer, se establecen en la primera página del nuevo documento.
</Accordion>

<Accordion title="Evento OnOptionsChanged">
  Si Text Validator genera el evento [OnOptionsChanged](/es/fine-reader/engine/visual-components-reference/itextvalidatorevents/onoptionschanged-method) y las propiedades ImageViewer, ZoomViewer, TextEditor y DocumentViewer del objeto ComponentSynchronizer ya se han configurado, se llama al método UpdateOptions de los objetos ImageViewer, ZoomViewer, TextEditor y DocumentViewer.
</Accordion>

<div id="see-also">
  ## Consulte también
</div>

[ComponentSynchronizer](/es/fine-reader/engine/visual-components-reference/supplementary-objects/componentsynchronizer)
