{"id":37314283,"url":"https://github.com/redocmx/client-dotnet","last_synced_at":"2026-01-16T03:07:08.192Z","repository":{"id":230044320,"uuid":"777252430","full_name":"redocmx/client-dotnet","owner":"redocmx","description":"Conversión de CFDI a PDF para .Net","archived":false,"fork":false,"pushed_at":"2024-04-09T15:33:32.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T17:38:58.823Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redocmx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-25T13:56:54.000Z","updated_at":"2024-03-27T14:49:04.000Z","dependencies_parsed_at":"2024-03-27T15:05:56.507Z","dependency_job_id":"1f42e324-8c7e-4127-99b2-8aaf03329988","html_url":"https://github.com/redocmx/client-dotnet","commit_stats":null,"previous_names":["redocmx/client-dotnet"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/redocmx/client-dotnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redocmx%2Fclient-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redocmx%2Fclient-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redocmx%2Fclient-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redocmx%2Fclient-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redocmx","download_url":"https://codeload.github.com/redocmx/client-dotnet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redocmx%2Fclient-dotnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28476835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:02:43.018Z","status":"ssl_error","status_checked_at":"2026-01-16T03:01:27.857Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-16T03:07:06.735Z","updated_at":"2026-01-16T03:07:08.184Z","avatar_url":"https://github.com/redocmx.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Converting CFDI to PDF with Redocmx for C#\n\n## Introduction\n\nThe `Redocmx` library is a C# client designed to interact with the [redoc.mx](https://redoc.mx) REST API for converting CFDIs (Comprobante Fiscal Digital por Internet) into PDFs. This library simplifies the process of sending XML data to the redoc.mx service and retrieving the converted PDF, along with transaction details and metadata, making it easy to integrate into .NET projects.\n\n## Installation\n\nTo install the `Redocmx` library, you can use NuGet Package Manager. Run the following command in the Package Manager Console:\n\n```powershell\nInstall-Package Redocmx -Version \u003cVERSION\u003e\n```\n\nReplace `\u003cVERSION\u003e` with the specific version of the `Redocmx` library you wish to install.\n\n## Usage\n\nStart by including `Redocmx` in your project:\n\n```csharp\nusing Redocmx;\n```\n\nThen, instantiate the `Redoc` class with your API token:\n\n```csharp\nclass Program\n{\n    static async Task Main(string[] args)\n    {\n        var redoc = new Redoc(\"api_token\");\n```\n\nYou can load the CFDI data from a file or directly from a string. Below is an example of loading from a file and converting it to PDF:\n\n```csharp\n        try\n        {\n            var cfdi = redoc.Cfdi.FromFile(\"./test.xml\");\n\n            var pdf = await cfdi.ToPdfAsync();\n\n            await File.WriteAllBytesAsync(\"./result.pdf\", pdf.Buffer);\n\n            Console.WriteLine($\"Transaction ID: {pdf.TransactionId}\");\n            Console.WriteLine($\"Total time MS: {pdf.TotalTimeMs}\");\n            Console.WriteLine($\"Total pages: {pdf.TotalPages}\");\n            Console.WriteLine($\"Metadata:\");\n\n            foreach (var pair in pdf.Metadata)\n            {\n                Console.WriteLine($\"    {pair.Key}: {pair.Value}\");\n            }\n        }\n        catch (Exception ex)\n        {\n            Console.Error.WriteLine($\"An error occurred during the conversion: {ex.Message}\");\n        }\n    }\n}\n```\n\n## Examples\n\nFor more detailed examples on how to use the library, please refer to the following resources:\n\n\n- [Basic example](https://github.com/redocmx/cfdi-a-pdf-ejemplos)\n- [Custom logo and colors](https://github.com/redocmx/cfdi-a-pdf-ejemplos)\n- [Change language to English](https://github.com/redocmx/cfdi-a-pdf-ejemplos)\n- [Add additional rich content](https://github.com/redocmx/cfdi-a-pdf-ejemplos)\n\n## API Reference\n\n### Redoc\n\nInstantiate the `Redoc` class to interact with the API. The constructor requires your API token.\n\n### Methods\n\n- `Cfdi.FromFile(string path)`: Loads CFDI data from a file.\n- `Cfdi.FromString(string xmlContent)`: Loads CFDI data directly from a string.\n- `ToPdfAsync()`: Converts the loaded CFDI to a PDF and returns metadata about the conversion.\n\n## Contributing\n\nWe welcome contributions! Feel free to submit pull requests or open issues for bugs, features, or improvements.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file in the repository for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredocmx%2Fclient-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredocmx%2Fclient-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredocmx%2Fclient-dotnet/lists"}