- Visão geral
- Contratos de Processamento de Documentos
- Notas de versão
- Sobre os Contratos de Processamento de Documentos
- Classe Box
- Interface IPersistedActivity
- Classe PrettyBoxConverter
- Interface IClassifierActivity
- Interface IClassifierCapabilitiesProvider
- Classe ClassifierDocumentType
- Classe ClassifierResult
- Classe ClassifierCodeActivity
- Classe ClassifierNativeActivity
- Classe ClassifierAsyncCodeActivity
- Classe ClassifierDocumentTypeCapability
- ContentValidationData Class
- EvaluatedBusinessRulesForFieldValue Class
- EvaluatedBusinessRuleDetails Class
- Classe ExtractorAsyncCodeActivity
- Classe ExtractorCodeActivity
- Classe ExtractorDocumentType
- Classe ExtractorDocumentTypeCapabilities
- Classe ExtractorFieldCapability
- Classe ExtractorNativeActivity
- Classe ExtractorResult
- FieldValue Class
- FieldValueResult Class
- Interface ICapabilitiesProvider
- Interface IExtractorActivity
- Classe ExtractorPayload
- Enumeração DocumentActionPriority
- Classe DocumentActionData
- Enumeração DocumentActionStatus
- Enumeração DocumentActionType
- Classe DocumentClassificationActionData
- Classe DocumentValidationActionData
- Classe UserData
- Classe Document
- Classe DocumentSplittingResult
- Classe DomExtensions
- Classe Page
- Classe PageSection
- Classe Polígono
- Classe PolygonConverter
- Classe de metadados
- Classe WordGroup
- Classe Word
- Enumeração ProcessingSource
- Classe ResultsTableCell
- Classe ResultsTableValue
- Classe ResultsTableColumnInfo
- Classe ResultsTable
- Enumeração Rotation
- Rule Class
- RuleResult Class
- RuleSet Class
- RuleSetResult Class
- Enumeração SectionType
- Enumeração WordGroupType
- Interface IDocumentTextProjection
- Classe ClassificationResult
- Classe ExtractionResult
- Classe ResultsDocument
- Classe ResultsDocumentBounds
- Classe ResultsDataPoint
- Classe ResultsValue
- Classe ResultsContentReference
- Classe ResultsValueTokens
- Classe ResultsDerivedField
- Enumeração ResultsDataSource
- Classe ResultConstants
- Classe SimpleFieldValue
- Classe TableFieldValue
- Classe DocumentGroup
- Classe DocumentTaxonomy
- Classe DocumentType
- Classe Field
- Enumeração FieldType
- FieldValueDetails Class
- Classe LanguageInfo
- Classe MetadataEntry
- Enumeração de tipo de texto
- Classe TypeField
- Interface ITrackingActivity
- Interface ITrainableActivity
- Interface ITrainableClassifierActivity
- Interface ITrainableExtractorActivity
- Classe TrainableClassifierAsyncCodeActivity
- Classe TrainableClassifierCodeActivity
- Classe TrainableClassifierNativeActivity
- Classe TrainableExtractorAsyncCodeActivity
- Classe TrainableExtractorCodeActivity
- Classe TrainableExtractorNativeActivity
- Classe BasicDataPoint - visualização
- Classe ExtractionResultHandler — visualização
- Document Understanding ML
- Document Understanding OCR Local Server
- Document Understanding
- Notas de versão
- Sobre o pacote de atividades Document Understanding
- Compatibilidade do projeto
- Configuração da conexão externa
- Definir Senha do PDF
- Merge PDFs
- Get PDF Page Count
- Extract PDF Text
- Extract PDF Images
- Extract PDF Page Range
- Extract Document Data
- Criar tarefa de validação e aguardar
- Aguarde a tarefa de validação e retome
- Create Validation Task
- Classificar Documento
- Create Classification Validation Task
- Create Classification Validation Task and Wait
- Aguardar a tarefa de Validação de Classificação e retomar
- IntelligentOCR
- Notas de versão
- Sobre o pacote de atividades IntelligentOCR
- Compatibilidade do projeto
- Carregar Taxonomia
- Digitize Document
- Classificar Escopo do Documento
- Classificador baseado em palavra-chave
- Document Understanding Project Classifier
- Intelligent Keyword Classifier
- Create Document Classification Action
- Create Document Validation Artifacts
- Recuperar artefatos de validação de documento
- Aguardar ação de classificação do documento e retomar
- Train Classifiers Scope
- Instrutor de Classificador Baseado em Palavra-chave
- Intelligent Keyword Classifier Trainer
- Escopo da Extração de Dados
- Document Understanding Project Extractor
- Document Understanding Project Extractor Trainer
- Regex Based Extractor
- Form Extractor
- Intelligent Form Extractor
- Rasurar documento
- Create Document Validation Action
- Wait For Document Validation Action And Resume
- Escopo de Extratores de Treinamento
- Exportar Resultados da Extração
- Machine Learning Extractor
- Machine Learning Extractor Trainer
- Machine Learning Classifier
- Machine Learning Classifier Trainer
- Classificador Generativo
- Extrator Generativo
- Configuração da autenticação
- Validação de documentos com ações de aplicativos
- Validação manual para digitalizar documentos
- Extração de dados baseada em âncora usando a atividade Intelligent Form Extractor
- Validation Station
- Atividades generativas — Boas práticas
- Extrator generativo — boas práticas
- Classificador generativo — Boas práticas
- Serviços de ML
- OCR
- Contratos de OCR
- Notas de versão
- Sobre os Contratos OCR
- Compatibilidade do projeto
- Interface IOCRActivity
- Classe OCRAsyncCodeActivity
- Classe OCRCodeActivity
- Classe OCRNativeActivity
- Character Class
- Classe OCRResult
- Classe Word
- Enumeração FontStyles
- Enumeração OCRRotation
- Classe OCRCapabilities
- Classe OCRScrapeBase
- Classe OCRScrapeFactory
- Classe ScrapeControlBase
- Enumeração ScrapeEngineUsages
- ScrapeEngineBase
- Classe ScrapeEngineFactory
- Classe ScrapeEngineProvider
- OmniPage
- PDF
- [Não listado] Abbyy
- [Não listado] Abbyy Embedded

Atividades do Document Understanding
Leitura de arquivos PDF
Você pode ler e extrair separadamente o conteúdo de arquivos .pdf usando atividades que podem ler todos os caracteres incluídos no documento.
Dependendo de suas necessidades, você pode usar uma atividade simples que pode reconhecer os personagens ou usar um mecanismo de OCR. Os benefícios de usar um mecanismo de OCR são que a leitura do documento pode ser aplicada mesmo em documentos digitalizados, assinados ou manuscritos.
O exemplo abaixo apresenta duas situações de leitura de um arquivo .pdf :
- The first one explains how to read the
.pdffile while using the Read PDF Text activity. - The second one explains how to read the
.pdffile while using the Read PDF With OCR activity. The main difference between the two scenarios is that the second one is also using OCR engines, meaning that the details of extracted information are more accurate than in the first case if the analyzed file is an image, scanned, or includes signed or handwritten fields. You can find both activities in the UiPath.PDF.Activities package.
É necessário apenas um fluxo de trabalho para os dois cenários, comum até o ponto de solicitar ao usuário a escolha do método de leitura desejado.
Etapas
- Abra o Studio e crie um Processo.
- Add a Flowchart container in the Workflow Designer.
- Create a variable named
chooseOption, with the GenericValue type, and no default value.Observação:Add your
.pdffiles to the project directory in order to be able to run the entire process from the same place or download this example in order to use the given file.
- Create a variable named
- Add an Input Dialog activity and connect it to the Start Node.
- No painel Propriedades, adicione a expressão
"Choose one option below:"ao campo Rótulo. - Add the expression
{"Read PDF Text", "Read PDF With OCR"}in the Options field. - Adicione o valor
"Options"ao campo Título. - Adicione a variável
chooseOptionno campo Resultado.
- No painel Propriedades, adicione a expressão
- Add a Flow Decision activity after the Input Dialog activity and connect it to it.
- No painel Propriedades, adicione a expressão
chooseOption = "Read PDF Text"ao campo Condição.
- No painel Propriedades, adicione a expressão
- Add a Sequence container and connect it to the True branch of the Flow Decision activity. The name of the Sequence should be Read PDF Text. This activity extracts information by using regular expressions.
-
Crie as variáveis exibidas na tabela a seguir:
Table 1. Variables to be created
Tipo de Variável Valor Padrão extractedTextString N/A arrayTextSystem.String[] N/A addressGenericValue N/A cityString N/A phoneNumberString N/A invoiceNumberString N/A vendorGenericValue N/A bankNameString N/A bankAccountString N/A ibanCodeString N/A
-
- Add a Sequence container and connect it to the False branch of the Flow Decision activity. The name of the Sequence should be Read PDF With OCR. This activity extracts information by using an OCR engine (Microsoft OCR and Tesseract OCR).
-
Crie as variáveis exibidas na tabela a seguir:
Table 2. Variables to be created
Tipo de Variável Valor Padrão extractedTextTesseractString N/A extractedTextMicrosoftString N/A Figure 1. Overview of the beginning of the workflow

-
- Read a PDF File using the Read PDF Text activity:
- Open the Read PDF Text sequence container by double-selecting it.
- Add a Read PDF Text activity inside the sequence.
- In the Properties panel, add the expression
"NPO Invoice.pdf"in the FileName field. - Add the value
"All"in the Range field. - Adicione a variável
extractedTextno campo Texto.
- In the Properties panel, add the expression
- Add an Assign activity after the Read PDF Text activity.
- Adicione a variável
arrayTextno campo Para. - Adicione a expressão
extractedText.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries)no campo Valor.
- Adicione a variável
- Adicione uma atividade If abaixo da atividade Assign.
- Adicione a expressão
arrayText(0).Equals("Tiefland Glass AG")no campo Condição.
- Adicione a expressão
- Adicione uma atividade Atribuir dentro do contêiner da Sequência.
- Adicione a variável
addressno campo Para. - Adicione a expressão
arrayText(2)no campo Valor.
- Adicione a variável
- Add another Assign activity and place it after the previous one.
- Adicione a variável
cityno campo Para. - Adicione a expressão
arrayText(3).Split(","c)(0)no campo Valor.
- Adicione a variável
- Add another Assign activity and place it after the previous one.
- Adicione a variável
phoneNumberno campo Para. - Adicione a expressão
arrayText(4).Split(":"c)(1).Split({"INVOICE"},StringSplitOptions.None)(0)no campo Valor.
- Adicione a variável
- Add another Assign activity and place it after the previous one.
- Adicione a variável
invoiceNumberno campo Para. - Adicione a expressão
arrayText(4).Split(":"c)(1).Split({"INVOICE"},StringSplitOptions.None)(1).Split("#"c)(1)no campo Valor.
- Adicione a variável
- Add another Assign activity and place it after the previous one.
- Adicione a variável
vendorno campo Para. - Adicione a expressão
arrayText(arrayText.Count-5)no campo Valor.
- Adicione a variável
- Add an Assign activity inside the Else field.
- Adicione a variável
addressno campo Para. - Adicione a expressão
arrayText(1)no campo Valor.
- Adicione a variável
- Add another Assign activity and place it after the previous one.
- Adicione a variável
cityno campo Para. - Adicione a expressão
arrayText(2).Split(","c)(0)no campo Valor.
- Adicione a variável
- Add another Assign activity and place it after the previous one.
- Adicione a variável
phoneNumberno campo Para. - Adicione a expressão
arrayText(3).Split(":"c)(1).Split({"INVOICE"},StringSplitOptions.None)(0)no campo Valor.
- Adicione a variável
- Add another Assign activity and place it after the previous one.
- Adicione a variável
invoiceNumberno campo Para. - Adicione a expressão
arrayText(3).Split(":"c)(1).Split({"INVOICE"},StringSplitOptions.None)(1).Split("#"c)(1)no campo Valor.
- Adicione a variável
- Add another Assign activity and place it after the previous one.
-
Adicione a variável
vendorno campo Para. -
Adicione a expressão
arrayText(arrayText.Count-5)no campo Valor.Figure 2. Overview of the sequence containing the Assign activities

-
- Place a For Each activity after the If container.
- Add the variable
arrayTextin the Value field.
- Add the variable
- Add an If activity inside the Body container of the For Each activity.
- Adicione a expressão
item.Contains("Bank Name:")no campo Condição.
- Adicione a expressão
- Add an Assign activity inside the Then field.
- Adicione a variável
bankNameno campo Para. - Adicione a expressão
item.Split(":"c)(1)no campo Valor.
- Adicione a variável
- Add an If activity after the previous one.
- Adicione a expressão
item.Contains("Bank Account:")no campo Condição.
- Adicione a expressão
- Add an Assign activity inside the Then field.
- Adicione a variável
bankNameno campo Para. - Adicione a expressão
item.Split(":"c)(1)no campo Valor.
- Adicione a variável
- Add an If activity after the previous one.
- Adicione a expressão
item.contains("IBAN Code:")no campo Condição.
- Adicione a expressão
- Add an Assign activity inside the Then field.
-
Adicione a variável
ibanCodeno campo Para. -
Adicione a expressão
item.Split(":"c)(1)no campo Valor.Figure 3. Overview of the For Each activity

-
- Return to the Read PDF Text sequence and add a Write Text File activity below the For Each activity.
-
Add the value
"InvoiceDetails.txt"in the FileName field. -
Adicione a expressão
"Invoice details"+Environment.NewLine+Environment.NewLine+"Vendor: "+vendor+Environment.NewLine+"Vendor address: "+address+Environment.NewLine+"City: "+city+Environment.NewLine+"Phone number:"+phoneNumber+Environment.NewLine+"Invoice number:"+invoiceNumber+Environment.NewLine+"Bank name:"+bankName+Environment.NewLine+"Bank account:"+bankAccount+Environment.NewLine+"IBAN Code:"+ibanCodeno campo Texto.Figure 4. Overview of the For Each container

-
- Return to the Main workflow working area.
- Read a PDF File using the Read PDF with OCR activity.
- Open the Read PDF With OCR sequence container.
- Drag a Read PDF With OCR activity inside the sequence.
- Add the value
"Invoice02.pdf"in the FileName field. - In the Properties panel, add the value
1in the DegreeOfParallelism field.
- Add the value
- Drag the Google OCR engine inside the Read PDF With OCR activity.
- No painel Propriedades, adicione a variável
extractedTextTesseractao campo Texto.
- No painel Propriedades, adicione a variável
- Drag another Read PDF With OCR activity and place it after the previous one.
- Add the value
"Invoice02.pdf"in the FileName field. - In the Properties panel, add the value
1in the DegreeOfParallelism field.
- Add the value
- Drag the Microsoft OCR engine inside the Read PDF With OCR activity.
- In the Properties panel add the variable
extractedTextMicrosoftin the Text field.
- In the Properties panel add the variable
- Drag a Write Text File activity below the Read PDF With OCR activity.
- Add the value
"OCRMicrosoft.txt"in the FileName field. - Adicione a variável
extractedTextMicrosoftno campo Texto.
- Add the value
- Drag a Write Text File activity below the previous Write Text File activity.
-
Add the value
"OCRTesseract.txt"in the FileName field. -
Adicione a variável
extractedTextTesseractno campo Texto.Figure 5. Overview of the Read PDF with OCR activity

-
- Execute o processo. O robô extrai os dados usando o processo especificado e salva a saída em um arquivo
.txt.
Visit the following link to download the example as a ZIP format: Example.