OCRmyPDF-DotNet
1.0.5
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package OCRmyPDF-DotNet --version 1.0.5
NuGet\Install-Package OCRmyPDF-DotNet -Version 1.0.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OCRmyPDF-DotNet" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OCRmyPDF-DotNet --version 1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OCRmyPDF-DotNet, 1.0.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install OCRmyPDF-DotNet as a Cake Addin #addin nuget:?package=OCRmyPDF-DotNet&version=1.0.5 // Install OCRmyPDF-DotNet as a Cake Tool #tool nuget:?package=OCRmyPDF-DotNet&version=1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
OCRmyPDF-DotNet
Este é um pequeno wrapper, feito em .NET 8/C#, para o projeto OCRmyPDF.
Instalação
Após a instalação, é necessário fazer algunas validações:
Ambiente Windows
- Siga a instalação conforme este link.
Ambiente Linux
- Siga a instalação conforme este link.
Imagem Docker
Caso deseje criar uma imagem Docker, será necessário adicionar o seguinte código ao seu Dockerfile:
RUN apt-get update && \
apt-get install -y python3.11 python3-pip
RUN apt install -y ocrmypdf
RUN apt-get install -y tesseract-ocr-eng tesseract-ocr-por tesseract-ocr-spa tesseract-ocr-fra
ENV PATH="/usr/bin:${PATH}"
RUN ln -sf /usr/bin/python3.11 /usr/bin/python && \
ln -sf /usr/bin/python3.11 /usr/bin/python3
Uso/Exemplos
O método principal, StartProcess
, espera a seguinte entidade:
public class Request
{
public string PythonVersion { get; set; } = string.Empty;
public string PythonHome { get; set; } = string.Empty;
public string PythonDLL { get; set; } = string.Empty;
public string InputFile { get; set; } = string.Empty;
public string OutputFile { get; set; } = string.Empty;
public string Language { get; set; } = "eng";
public bool RedoOCR { get; set; } = false;
}
- A propriedade
PythonVersion
é a versão do Python que será utilizada. Caso não seja informada, será retornado um erro de versão não encontrada; - A propriedade
PythonHome
é a instalação do Python que será utilizada, apenas para ambiente Windows. Caso não seja informada, será utilizada o valor padrãoC:\Program Files\Python\Python
e a versão enviada noPythonVersion
; - A propriedade
PythonDLL
é a DLL/SO que será utilizada. Caso não seja informada será utilizada a DLL/SO padrão do Python, para ambiente Windows é opython3.11.dll
, exemplo, e para ambiente Linux é o/usr/lib/x86_64-linux-gnu/libpython3.11.so
, exemplo; - A propriedade
InputFile
será o arquivo a ser processado; - A propriedade
OutputFile
será o arquivo processado e retornado; - A propriedade
Language
é a linguagem do arquivo (pt/eng/etc...); - A propriedade
RedoOCR
será utilizada quando o arquivo já é selecionável, mas ainda assim é necessário ser refeito o OCR;
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- QuantConnect.pythonnet (>= 2.0.35)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.