using IronPdf;
using IronSoftware.Drawing;
using System;
PdfDocument pdf = PdfDocument.FromFile("sample.pdf");
// Convertir PDF en cadena HTML
string html = pdf.ToHtmlString();
Console.WriteLine(html);
// Convertir PDF en archivo HTML
pdf.SaveAsHtml("myHtml.html");
// Opciones de configuración de PDF a HTML
HtmlFormatOptions htmlformat = new HtmlFormatOptions();
htmlformat.BackgroundColor = Color.White;
htmlformat.H1Color = Color.Blue;
htmlformat.H1FontSize = 25;
htmlformat.H1TextAlignment = TextAlignment.Center;
htmlformat.PdfPageMargin = 10;
// Convertir PDF en archivo HTML
pdf.SaveAsHtml("myHtmlConfigured.html", true, "Hello World", htmlFormatOptions: htmlformat);
Imports IronPdf
Imports IronSoftware.Drawing
Imports System
Private pdf As PdfDocument = PdfDocument.FromFile("sample.pdf")
' Convertir PDF en cadena HTML
Private html As String = pdf.ToHtmlString()
Console.WriteLine(html)
' Convertir PDF en archivo HTML
pdf.SaveAsHtml("myHtml.html")
' Opciones de configuración de PDF a HTML
Dim htmlformat As New HtmlFormatOptions()
htmlformat.BackgroundColor = Color.White
htmlformat.H1Color = Color.Blue
htmlformat.H1FontSize = 25
htmlformat.H1TextAlignment = TextAlignment.Center
htmlformat.PdfPageMargin = 10
' Convertir PDF en archivo HTML
pdf.SaveAsHtml("myHtmlConfigured.html", True, "Hello World", htmlFormatOptions:= htmlformat)