محول HTML لـ .NET
إدخال إلى HTML Converter for .NET
HTML Converter for .NET هو ملحق قوي يتيح للمطورين تحويل مستندات PDF إلى صفحات HTML. يوفر هذا الدليل نظرة عامة على الميزات المتاحة ويشرح كيفية القيام بالمهام الشائعة باستخدام أمثلة الرمز في .Net.
تثبيت HTML Converter
للبدء مع محول HTML لـ .NET ، تحتاج إلى تثبيت حزمة Aspose.Pdf NuGet. يمكنك القيام بذلك عن طريق تشغيل الأمر التالي في وحدة التحكم في الحزمة Nu Get:
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);