Skip to content
1,120 changes: 690 additions & 430 deletions Document-Processing/PDF/PDF-Library/NET/Working-with-DigitalSignature.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

334 changes: 242 additions & 92 deletions Document-Processing/PDF/PDF-Library/NET/Working-with-Document.md

Large diffs are not rendered by default.

76 changes: 60 additions & 16 deletions Document-Processing/PDF/PDF-Library/NET/Working-with-Flow-Layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ PdfDocument pdfDocument = render.ConvertToPDF(wordDocument);
render.Dispose();
wordDocument.Dispose();

//Save the document into stream.
MemoryStream stream = new MemoryStream();
pdfDocument.Save(stream);
//Close the documents.
//Save and close the PDF document.
pdfDocument.Save("Output.pdf");
pdfDocument.Close(true);
//Close the document.
wordDocument.Close();
{% endhighlight %}

{% highlight c# tabtitle="C# [Windows-specific]" %}
Expand Down Expand Up @@ -180,6 +180,11 @@ You can create PDF document with text and image using the following code snippet

{% tabs %}
{% highlight c# tabtitle="C# [Cross-platform]" %}

using Syncfusion.Pdf;
using Syncfusion.DocIO.DLS;
using Syncfusion.DocToPDFConverter;

//A new document is created.
WordDocument document = new WordDocument();
//Adding a new section to the document.
Expand Down Expand Up @@ -230,15 +235,18 @@ PdfDocument pdfDocument = render.ConvertToPDF(document);
render.Dispose();
document.Dispose();

//Save the document into stream.
MemoryStream stream = new MemoryStream();
pdfDocument.Save(stream);
//Close the documents.
//Saves the PDF file.
pdfDocument.Save("Sample.pdf");
pdfDocument.Close(true);
document.Close();
{% endhighlight %}

{% highlight c# tabtitle="C# [Windows-specific]" %}

using Syncfusion.Pdf;
using Syncfusion.DocIO.DLS;
using Syncfusion.DocToPDFConverter;

//A new document is created.
WordDocument document = new WordDocument();
//Adding a new section to the document.
Expand Down Expand Up @@ -293,6 +301,11 @@ document.Close();
{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}

Imports Syncfusion.DocIO.DLS
Imports Syncfusion.DocToPDFConverter
Imports Syncfusion.Pdf

'A new document is created
Dim document As New WordDocument()
'Adding a new section to the document
Expand Down Expand Up @@ -355,6 +368,11 @@ You can create PDF document with simple table using the following code snippet.

{% tabs %}
{% highlight c# tabtitle="C# [Cross-platform]" %}

using Syncfusion.Pdf;
using Syncfusion.DocIO.DLS;
using Syncfusion.DocToPDFConverter;

//Creates a new Word document.
WordDocument wordDocument = new WordDocument();
//Adding a new section to the document.
Expand Down Expand Up @@ -424,15 +442,19 @@ PdfDocument pdfDocument = render.ConvertToPDF(wordDocument);
render.Dispose();
wordDocument.Dispose();

//Save the document into stream.
MemoryStream stream = new MemoryStream();
pdfDocument.Save(stream);
//Close the documents.
//Save and close the PDF document.
pdfDocument.Save("Output.pdf");
pdfDocument.Close(true);
//Close the document.
wordDocument.Close();
{% endhighlight %}

{% highlight c# tabtitle="C# [Windows-specific]" %}

using Syncfusion.Pdf;
using Syncfusion.DocIO.DLS;
using Syncfusion.DocToPDFConverter;

//Creates a new Word document.
WordDocument wordDocument = new WordDocument();
//Adding a new section to the document.
Expand Down Expand Up @@ -508,6 +530,11 @@ wordDocument.Close();
{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}

Imports Syncfusion.DocIO.DLS
Imports Syncfusion.DocToPDFConverter
Imports Syncfusion.Pdf

'Creates a new Word document
Dim wordDocument As New WordDocument()
'Adding a new section to the document
Expand Down Expand Up @@ -593,7 +620,13 @@ Syncfusion Essential<sup>&reg;</sup> PDF supports creating a PDF document with f
The following code snippet explains how to create a PDF document with image, paragraph text, header text, a line below the header text, and a table using flow model.

{% tabs %}
{% highlight c# tabtitle="C#" %}
{% highlight c# tabtitle="C#" [Cross-platform] %}

using Syncfusion.Drawing;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.Grid;

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Add a page to the document.
Expand Down Expand Up @@ -650,15 +683,20 @@ grid.ApplyBuiltinStyle(PdfGridBuiltinStyle.GridTable5DarkAccent5);
//Draw the table in page, below the line with a height gap of 20.
grid.Draw(page, new PointF(0, layoutResult.Bounds.Bottom + 20));

//Saving the PDF to the MemoryStream.
MemoryStream stream = new MemoryStream();
document.Save(stream);
//Save the PDF document.
document.Save("Output.pdf");
//Close the instance of PdfDocument.
document.Close(true);

{% endhighlight %}

{% highlight c# tabtitle="C# [Windows-specific]" %}

using System.Drawing;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.Grid;

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Add a page to the document.
Expand Down Expand Up @@ -722,6 +760,12 @@ document.Close(true);
{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}

Imports System.Drawing
Imports Syncfusion.Pdf
Imports Syncfusion.Pdf.Graphics
Imports Syncfusion.Pdf.Grid

'Create a new PDF document
Dim document As PdfDocument = New PdfDocument
'Add a page to the document
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ The below code snippet explains how to draw the page numbers in footer using aut

{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/PDF-Examples/master/Header%20and%20Footer/Adding-an-automatic-field-in-header-and-footer/.NET/Adding-an-automatic-field-in-header-and-footer/Program.cs" %}

using Syncfusion.Drawing;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;

//Create a new PDF document.
PdfDocument pdfDocument = new PdfDocument();
//Add a page to the PDF document
Expand Down Expand Up @@ -52,16 +56,18 @@ compositeField.Draw(footer.Graphics, new PointF(470, 40));
//Add the footer template at the bottom.
pdfDocument.Template.Bottom = footer;

//Save the document into stream.
MemoryStream stream = new MemoryStream();
pdfDocument.Save(stream);
//Closes the document.
//Save and close the document.
pdfDocument.Save("Output.pdf");
pdfDocument.Close(true);

{% endhighlight %}

{% highlight c# tabtitle="C# [Windows-specific]" %}

using System.Drawing;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;

//Create a new PDF document.
PdfDocument pdfDocument = new PdfDocument();
//Add a page to the PDF document
Expand Down Expand Up @@ -98,6 +104,10 @@ pdfDocument.Close(true);

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}

Imports Syncfusion.Drawing
Imports Syncfusion.Pdf
Imports Syncfusion.Pdf.Graphics

'Create a new PDF document.
Dim pdfDocument As New PdfDocument()
'Add a page to the PDF document.
Expand Down Expand Up @@ -146,6 +156,10 @@ The example below illustrates how to implement a dynamic footer that updates uni

{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/PDF-Examples/master/Header%20and%20Footer/Adding-dynamic-headers-and-footers-in-PDF/.NET/Adding-dynamic-headers-and-footers-in-PDF/Program.cs" %}

using Syncfusion.Drawing;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;

// Create a new PDF document.
PdfDocument document = new PdfDocument();

Expand Down Expand Up @@ -213,10 +227,7 @@ PdfPage firstPage = document.Pages.Add();
textElement.Draw(firstPage, new PointF(0, headerHeight));

// Save and close the document.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.Write))
{
document.Save(outputFileStream);
}
document.Save("Output.pdf");
document.Close(true);

// Add header and footer to every page.
Expand Down Expand Up @@ -249,6 +260,10 @@ static void PageAddedHandler(object sender, PageAddedEventArgs e)

{% highlight c# tabtitle="C# [Windows-specific]" %}

using System.Drawing;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;

// Create a new PDF document.
PdfDocument document = new PdfDocument();

Expand Down Expand Up @@ -349,6 +364,10 @@ static void PageAddedHandler(object sender, PageAddedEventArgs e)

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}

Imports Syncfusion.Drawing
Imports Syncfusion.Pdf
Imports Syncfusion.Pdf.Graphics

' Create a new PDF document.
Dim document As New PdfDocument()

Expand Down
Loading