NET용 HTML 변환기

.NET에 대한 HTML 변환기 소개

HTML Converter for .NET은 개발자가 PDF 문서를 HTML 페이지로 변환 할 수있는 강력한 플러그인입니다.이 가이드는 사용 가능한 기능에 대한 개요를 제공하고 .net에서 코드 예를 사용하여 일반적인 작업을 수행하는 방법을 설명합니다.

HTML 변환기 설치

.NET에 대한 HTML Converter를 사용하여 시작하려면 Aspose.Pdf NuGet 패키지를 설치해야 합니다.Nuget Package Manager Console에서 다음 명령을 실행하여 이렇게 할 수 있습니다.

Install-Package Aspose.PDF

대신 DLL을 다운로드하고 프로젝트에 대한 참조로 추가할 수 있습니다.

PDF를 HTML로 변환하는 방법

PDF 문서를 HTML으로 변환하는 것은 HTML Converter의 주요 기능 중 하나입니다. PdfHtml 클래스는 PDF 문서를 업로드하고 HTML 파일로 저장합니다.

// Specify the input and output paths for the PDF document.
var inputPath = Path.Combine(@"C:\Samples\", "sample.pdf");
var outputPath = Path.Combine(@"C:\Samples\", "sample.html");

// Create a new instance of the PdfHtml class.
var plugin = new PdfHtml();

// Create a new instance of the PdfToHtmlOptions class.
var options = new PdfToHtmlOptions(PdfToHtmlOptions.SaveDataType.FileWithEmbeddedResources);

// Add the input and output paths to the PdfToHtmlOptions.
options.AddInput(new FileDataSource(inputPath));
options.AddOutput(new FileDataSource(outputPath));

// Process the PDF to HTML conversion and get the result container.
var resultContainer = plugin.Process(options);

// Get the result from the result container.
var result = resultContainer.ResultCollection[0];

// Print the result to the console.
Console.WriteLine(result);
 한국어