Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jordancampos20/c20.htmltopdf

Exporta HTML para PDF
https://github.com/jordancampos20/c20.htmltopdf

csharp html5 nuget-package selenium selenium-webdriver

Last synced: 26 days ago
JSON representation

Exporta HTML para PDF

Awesome Lists containing this project

README

        

# C20.HtmlToPDF
PT-BR:
funciona normalmente no Windows x86 e x64,
não foi implementado para os outros sistemas.

EN:
works normally on Windows x86 and x64,
it has not been implemented for other systems.

# Example
```cs
using C20.HtmlToPDF;

var fileBase64String = "";

var pathDocuments =
Environment.GetFolderPath(
Environment.SpecialFolder.MyDocuments);

const string html = """





Document


Hello World...




""";

fileBase64String = ConvertToPdf.ConverterHtml(html, new ConvertToPdfOptions(orientation: PrintOrientationOptions.Portrait));

File.WriteAllBytes($@"{pathDocuments}\example_html.pdf", Convert.FromBase64String(fileBase64String));

const string url = "https://www.google.com.br";

fileBase64String = ConvertToPdf.ConverterPage(url, new ConvertToPdfOptions(orientation: PrintOrientationOptions.Portrait));

File.WriteAllBytes($@"{pathDocuments}\example_page.pdf", Convert.FromBase64String(fileBase64String));
```