diff --git a/HTML to PDF/Blink/Convert-HTML-to-PDF-in-offline-mode/.NET/Convert-HTML-to-PDF-in-offline-mode/Data/Input.html b/HTML to PDF/Blink/Convert-HTML-to-PDF-in-offline-mode/.NET/Convert-HTML-to-PDF-in-offline-mode/Data/Input.html new file mode 100644 index 00000000..a6c86929 --- /dev/null +++ b/HTML to PDF/Blink/Convert-HTML-to-PDF-in-offline-mode/.NET/Convert-HTML-to-PDF-in-offline-mode/Data/Input.html @@ -0,0 +1,47 @@ + + + + + Introduction to PDF Format + + + +

Understanding the PDF Document Format

+
+

The Portable Document Format (PDF) is a file format developed by Adobe in the early 1990s to present documents consistently across different devices and platforms. It encapsulates text, fonts, images, and graphics in a single file, preserving the layout and formatting regardless of the software or hardware used to view it.

+
+ +

Key Features

+
+

PDFs support a wide range of features including hyperlinks, bookmarks, annotations, encryption, and digital signatures. They are widely used for forms, manuals, reports, and legal documents due to their reliability and security.

+
+ +

Advantages

+
+

One of the main advantages of PDF is its platform independence. Whether you're using Windows, macOS, Linux, or a mobile device, a PDF will look the same. Additionally, PDFs can be compressed to reduce file size and can be protected with passwords or certificates.

+
+ +

Use Cases

+
+

PDFs are commonly used in business, education, and government sectors. They are ideal for sharing read-only documents, printing materials, and archiving important files. Tools like Adobe Acrobat, Foxit, and various open-source libraries allow users to create, edit, and manage PDFs efficiently.

+
+ + + diff --git a/HTML to PDF/Blink/Convert-HTML-to-PDF-in-offline-mode/.NET/Convert-HTML-to-PDF-in-offline-mode/Program.cs b/HTML to PDF/Blink/Convert-HTML-to-PDF-in-offline-mode/.NET/Convert-HTML-to-PDF-in-offline-mode/Program.cs index 9a7730ba..d55593ab 100644 --- a/HTML to PDF/Blink/Convert-HTML-to-PDF-in-offline-mode/.NET/Convert-HTML-to-PDF-in-offline-mode/Program.cs +++ b/HTML to PDF/Blink/Convert-HTML-to-PDF-in-offline-mode/.NET/Convert-HTML-to-PDF-in-offline-mode/Program.cs @@ -1,23 +1,18 @@ using Syncfusion.HtmlConverter; using Syncfusion.Pdf; -using System.Runtime.InteropServices; //Initialize the HTML to PDF converter. HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(); - -//Initialize blink converter settings. BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings(); -//Enable offline mode. +//Enable offline mode blinkConverterSettings.EnableOfflineMode = true; -//Assign Blink converter settings to HTML converter. +//Assign Blink converter settings to HTML converter htmlConverter.ConverterSettings = blinkConverterSettings; - -//Convert URL to PDF document. -PdfDocument document = htmlConverter.Convert("https://www.google.com"); - -//Save the PDF document -document.Save(fileStream); -//Close the document. +string inputHTML = Path.GetFullPath(@"Data/Input.html"); +//Convert URL to PDF +PdfDocument document = htmlConverter.Convert(inputHTML); +//Save and close the PDF document. +document.Save(Path.GetFullPath(@"Output/Output.pdf")); document.Close(true); \ No newline at end of file