Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.HtmlConverter;
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.Runtime.InteropServices;

//Initialize the HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
Expand All @@ -19,11 +16,7 @@
//Convert URL to PDF document.
PdfDocument document = htmlConverter.Convert(urlToConvert);

//Create file stream.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/HTML-to-PDF.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document
document.Save(fileStream);
}
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.Runtime.InteropServices;

//Initialize the HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
Expand All @@ -19,11 +18,7 @@
//Convert URL to PDF document.
PdfDocument document = htmlConverter.Convert("https://www.example.com");

//Create file stream.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/HTML-to-PDF.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document
document.Save(fileStream);
}
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.Runtime.InteropServices;

//Initialize HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
Expand All @@ -12,11 +11,8 @@
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF.
PdfDocument document = htmlConverter.Convert("file:///D:/PDF-Examples/HTML%20to%20PDF/Blink/Accessible_PDF_In_HTML_to_PDF/.NET/Accessible%20PDF/Data/Input.html");
//Create file stream.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/HTML-to-PDF.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document
document.Save(fileStream);
}

//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ static void Main(string[] args)
// Save the PDF to a memory stream for further processing
using (MemoryStream stream = new MemoryStream())
{
document.Save(stream); // Save converted PDF to memory
stream.Position = 0; // Reset stream position
document.Close(true); // Close the original document
document.Save(stream);
stream.Position = 0;
document.Close(true);

// Replace the "signature" textarea with an actual signature field
AddPdfSignatureField(stream);
Expand Down Expand Up @@ -67,11 +67,8 @@ static void AddPdfSignatureField(MemoryStream stream)
loadedForm.Fields.Add(signatureField);
}

// Save the modified document to disk
using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.Write))
{
loadedDocument.Save(outputStream);
}
// Save the modified document
loadedDocument.Save(Path.GetFullPath(@"Output/Output.pdf"));
// Close the document and release resources
loadedDocument.Close(true);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Drawing;
using Syncfusion.Drawing;
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.Runtime.InteropServices;

//Initialize the HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
Expand All @@ -19,11 +16,8 @@
//Convert URL to PDF document.
PdfDocument document = htmlConverter.Convert("https://www.google.com");

//Create file stream.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/HTML-to-PDF.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document
document.Save(fileStream);
}
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));

//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.HtmlConverter;
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.Runtime.InteropServices;


//Initialize the HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
Expand All @@ -19,11 +15,8 @@
//Convert URL to PDF document.
PdfDocument document = htmlConverter.Convert(Path.GetFullPath(@"Data/Input.html"));

//Create file stream.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/HTML-to-PDF.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document
document.Save(fileStream);
}
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));

//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.HtmlConverter;
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.Runtime.InteropServices;

Expand All @@ -19,11 +17,7 @@
//Convert URL to PDF document.
PdfDocument document = htmlConverter.Convert("https://www.google.com");

//Create file stream.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/HTML-to-PDF.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document
document.Save(fileStream);
}
//Save the PDF document
document.Save(fileStream);
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.HtmlConverter;
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.Runtime.InteropServices;


//Initialize the HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
Expand All @@ -20,11 +16,7 @@
//Convert URL to PDF document.
PdfDocument document = htmlConverter.Convert("https://www.example.com");

//Create file stream.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/HTML-to-PDF.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document
document.Save(fileStream);
}
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.HtmlConverter;
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.Runtime.InteropServices;

//Initialize the HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();

//Convert Partial webpage to PDF document.
PdfDocument document = htmlConverter.ConvertPartialHtml(Path.GetFullPath(@"Data/Input.html"), "picture");

//Create file stream.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document
document.Save(fileStream);
}
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.HtmlConverter;
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.Runtime.InteropServices;

//Initialize HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
Expand All @@ -13,11 +10,7 @@
//Convert HTML string to PDF document.
PdfDocument document = htmlConverter.Convert(htmlText, baseUrl);

//Create file stream.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document
document.Save(fileStream);
}
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Drawing;
using Syncfusion.Drawing;
using Syncfusion.HtmlConverter;
using System.Runtime.InteropServices;

//Initialize HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.HtmlConverter;
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.Runtime.InteropServices;

//Initialize HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
Expand All @@ -19,11 +16,7 @@
//Convert URL to PDF document.
PdfDocument document = htmlConverter.Convert("https://httpbin.org/headers");

//Create file stream.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document
document.Save(fileStream);
}
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.HtmlConverter;
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;

//Initialize HTML to PDF converter.
Expand All @@ -12,11 +10,8 @@
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF document.
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Create file stream.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document
document.Save(fileStream);
}

//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Drawing;
using Syncfusion.Drawing;
using Syncfusion.HtmlConverter;
using System.Runtime.InteropServices;

//Initialize HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.HtmlConverter;
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.Runtime.InteropServices;

//Initialize the HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
Expand All @@ -20,11 +17,7 @@
//Convert URL to PDF document.
PdfDocument document = htmlConverter.Convert("https://www.example.com");

//Create file stream.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document
document.Save(fileStream);
}
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.Runtime.InteropServices;

//Initialize the HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
Expand All @@ -19,11 +18,7 @@
//Convert HTML to PDF document.
PdfDocument document = htmlConverter.Convert(Path.GetFullPath(@"Data/Input.html"));

//Create file stream.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document
document.Save(fileStream);
}
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Drawing;
using Syncfusion.Drawing;
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.HtmlToPdf;
using System.Runtime.InteropServices;

//Initialize the HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
Expand All @@ -30,11 +27,7 @@
//Convert HTML to PDF document.
PdfDocument document = htmlConverter.Convert(Path.GetFullPath(@"Data/Input.html"));

//Create file stream.
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document
document.Save(fileStream);
}
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
//Close the document.
document.Close(true);
Loading
Loading