Lbe.Documents 0.1.0

dotnet add package Lbe.Documents --version 0.1.0
                    
NuGet\Install-Package Lbe.Documents -Version 0.1.0
                    
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="Lbe.Documents" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lbe.Documents" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Lbe.Documents" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lbe.Documents --version 0.1.0
                    
#r "nuget: Lbe.Documents, 0.1.0"
                    
#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.
#:package Lbe.Documents@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lbe.Documents&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Lbe.Documents&version=0.1.0
                    
Install as a Cake Tool

Lbe.Documents

CI

Biblioteca pequeña de .NET 10 para generar el mismo reporte tabular en DOCX, XLSX y PDF, y extraer la capa de texto de un PDF. Usa Open XML SDK, ClosedXML, PDFsharp y PdfPig.

Cuando la primera versión esté publicada en NuGet.org, instálala con:

dotnet add package Lbe.Documents --version 0.1.0

Mientras tanto, clona el repositorio y añade una referencia al proyecto de la biblioteca desde tu aplicación:

dotnet add <ruta-a-tu-aplicacion.csproj> reference src/Lbe.Documents/Lbe.Documents.csproj

La versión 0.1.0 también se puede empaquetar localmente. Consulta cómo se publica para configurar NuGet.org y lanzar un release.

Inicio rápido

using Lbe.Documents;

var report = new TabularReport(
    "Pedidos",
    ["Id", "Cliente", "Importe"],
    [["A-001", "Ana", "125.00"]]);

using var word = File.Create("pedidos.docx");
DocumentExporter.WriteDocx(report, word);

using var excel = File.Create("pedidos.xlsx");
DocumentExporter.WriteXlsx(report, excel);

El ejemplo completo también crea un PDF y vuelve a leer su texto. Para el PDF debes suministrar una fuente TTF y configurar el IFontResolver de PDFsharp antes de crear XFont; así funciona también en Linux sin depender de fuentes instaladas en el servidor. No se incluye un archivo de fuente en el repositorio.

dotnet run --project examples/Lbe.Documents.Example -- ./salida C:/Windows/Fonts/arial.ttf

Alcance y límites

  • Los valores de XLSX se escriben como texto para conservar IDs y ceros iniciales. Si necesitas fórmulas o tipos numéricos, trabaja directamente con ClosedXML.
  • El PDF usa una tabla simple; el texto demasiado ancho se acorta visualmente con puntos suspensivos. DOCX y XLSX conservan el valor completo.
  • ExtractPdfText lee PDFs con capa de texto. Para escaneos hace falta OCR, que aquí no está incluido.
  • Open XML SDK no convierte DOCX a PDF ni ofrece un motor de maquetación de Word.
  • La biblioteca no automatiza Microsoft Office y no requiere instalarlo en el servidor.

Desarrollo

dotnet test tests/Lbe.Documents.Tests/Lbe.Documents.Tests.csproj
dotnet pack src/Lbe.Documents/Lbe.Documents.csproj -c Release

El código es MIT. Revisa también las licencias de las dependencias y de la fuente TTF que uses en tu aplicación.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 53 9/22/2026