Skip to content

Commit

Permalink
927524_ft Resolved the FT readme alignment issue and output issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
sameerkhan001 committed Dec 11, 2024
1 parent 02f336b commit ce8fa2e
Show file tree
Hide file tree
Showing 19 changed files with 100 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ The Syncfusion [.NET Core PDF library](https://www.syncfusion.com/document-proce

Follow these steps to compress PDF files using the Syncfusion library:

1. **Create a new project**: Set up a new C# Console Application project.
Step 1: **Create a new project**: Set up a new C# Console Application project.

2. **Install the NuGet package**: Add the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package to your project from [NuGet.org](https://www.nuget.org/).
Step 2: **Install the NuGet package**: Add the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package to your project from [NuGet.org](https://www.nuget.org/).

3. **Add required namespaces**: Include the following namespaces in your `Program.cs` file:
Step 3: **Add required namespaces**: Include the following namespaces in your `Program.cs` file:

```csharp
using Syncfusion.Pdf.Parsing;
using Syncfusion.Pdf;
```

4. **Implement PDF compression**: Use the following code snippet in `Program.cs` to compress PDF files:
Step 4: **Implement PDF compression**: Use the following code snippet in `Program.cs` to compress PDF files:

```csharp
// Open a file stream to read the input PDF file
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using Syncfusion.Drawing;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.Interactive;
using Syncfusion.Pdf.Parsing;
using Syncfusion.Pdf.Security;
Expand Down Expand Up @@ -29,7 +30,7 @@
signature.Reason = "I am the author of this document.";

// Load the image for the signature field
FileStream imageStream = new FileStream(Path.GetFullPath(@"Data/signature.png"), FileMode.Open, FileAccess.Read);
FileStream imageStream = new FileStream(Path.GetFullPath(@"..Data/signature.png"), FileMode.Open, FileAccess.Read);
PdfBitmap signatureImage = new PdfBitmap(imageStream);

// Draw the image on the signature field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@ The Syncfusion [.NET Core PDF library](https://www.syncfusion.com/document-proce

Follow these steps to digitally sign PDF files using the Syncfusion library:

1. **Create a new project**: Start by creating a new C# Console Application project.
Step 1: **Create a new project**: Start by creating a new C# Console Application project.

2. **Install the NuGet package**: Add the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package to your project from [NuGet.org](https://www.nuget.org/).
Step 2: **Install the NuGet package**: Add the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package to your project from [NuGet.org](https://www.nuget.org/).

3. **Include necessary namespaces**: Add the following namespaces in your `Program.cs` file:
Step 3: **Include necessary namespaces**: Add the following namespaces in your `Program.cs` file:

```csharp
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.Parsing;
using Syncfusion.Pdf.Security;
using Syncfusion.Drawing;
using Syncfusion.Pdf.Interactive;
```

4. **Add digital signature code**: Use the following code snippet in `Program.cs` to add a digital signature to a PDF file:
Step 4: **Add digital signature code**: Use the following code snippet in `Program.cs` to add a digital signature to a PDF file:

```csharp
// Open the existing PDF document as a stream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ The Syncfusion [.NET Core PDF library](https://www.syncfusion.com/document-proce

Follow these steps to create a PDF form with a textbox field:

1. **Create a new project**: Start by creating a new C# Console Application project.
Step 1: **Create a new project**: Start by creating a new C# Console Application project.

2. **Install the NuGet package**: Add the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package to your project from [NuGet.org](https://www.nuget.org/).
Step 2: **Install the NuGet package**: Add the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package to your project from [NuGet.org](https://www.nuget.org/).

3. **Include necessary namespaces**: Add the following namespaces in your `Program.cs` file:
Step 3: **Include necessary namespaces**: Add the following namespaces in your `Program.cs` file:

```csharp
using Syncfusion.Drawing;
Expand All @@ -19,7 +19,7 @@ Follow these steps to create a PDF form with a textbox field:
using Syncfusion.Pdf.Interactive;
```

4. **Create PDF forms**: Implement the following code in `Program.cs` to add a textbox field to a PDF document:
Step 4: **Create PDF forms**: Implement the following code in `Program.cs` to add a textbox field to a PDF document:

```csharp
// Create a new PDF document
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@

//Initialize HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
//Set command line arugument to run without the sandbox.
blinkConverterSettings.CommandLineArguments.Add("--no-sandbox");
blinkConverterSettings.CommandLineArguments.Add("--disable-setuid-sandbox");
}
//Assign Blink converter settings to HTML converter.
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF document.
PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com");
//Create file stream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ The Syncfusion [.NET Core PDF library](https://www.syncfusion.com/document-proce

Follow these steps to convert HTML content into a PDF file using the Syncfusion library:

1. **Create a new project**: Initialize a new C# Console Application project.
Step 1: **Create a new project**: Initialize a new C# Console Application project.

2. **Install the NuGet package**: Add the [Syncfusion.HtmlToPdfConverter.Net.Windows](https://www.nuget.org/packages/Syncfusion.HtmlToPdfConverter.Net.Windows) package as a reference in your .NET Standard application from [NuGet.org](https://www.nuget.org/).
Step 2: **Install the NuGet package**: Add the [Syncfusion.HtmlToPdfConverter.Net.Windows](https://www.nuget.org/packages/Syncfusion.HtmlToPdfConverter.Net.Windows) package as a reference in your .NET Standard application from [NuGet.org](https://www.nuget.org/).

3. **Include necessary namespaces**: Add the following namespaces in your `Program.cs` file:
Step 3: **Include necessary namespaces**: Add the following namespaces in your `Program.cs` file:

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

4. **Convert HTML to PDF**: Implement the following code in `Program.cs` to convert a website URL to a PDF file:
Step 4: **Convert HTML to PDF**: Implement the following code in `Program.cs` to convert a website URL to a PDF file:

```csharp
// Initialize the HTML to PDF converter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ The Syncfusion [.NET Core PDF library](https://www.syncfusion.com/document-proce

Follow these steps to convert an image into a PDF file using the Syncfusion library:

1. **Create a new project**: Start a new C# Console Application project.
Step 1: **Create a new project**: Start a new C# Console Application project.

2. **Install the NuGet package**: Add the [Syncfusion.Pdf.Imaging.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Imaging.Net.Core) package as a reference to your project from [NuGet.org](https://www.nuget.org/).
Step 2: **Install the NuGet package**: Add the [Syncfusion.Pdf.Imaging.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Imaging.Net.Core) package as a reference to your project from [NuGet.org](https://www.nuget.org/).

3. **Include necessary namespaces**: Add the following namespace in your `Program.cs` file:
Step 3: **Include necessary namespaces**: Add the following namespace in your `Program.cs` file:

```csharp
using Syncfusion.Pdf;
```

4. **Convert image to PDF**: Implement the following code in `Program.cs` to convert an image into a PDF file:
Step 4: **Convert image to PDF**: Implement the following code in `Program.cs` to convert an image into a PDF file:

```csharp
// Create an instance of the ImageToPdfConverter class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ The Syncfusion [.NET Core PDF library](https://www.syncfusion.com/document-proce

Follow these steps to merge PDF files using the Syncfusion library:

1. **Create a new project**: Start by creating a new C# Console Application project.
Step 1: **Create a new project**: Start by creating a new C# Console Application project.

2. **Install the NuGet package**: Reference the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package in your project from [NuGet.org](https://www.nuget.org/).
Step 2: **Install the NuGet package**: Reference the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package in your project from [NuGet.org](https://www.nuget.org/).

3. **Include required namespaces**: Add the following namespace in your `Program.cs` file:
Step 3: **Include required namespaces**: Add the following namespace in your `Program.cs` file:

```csharp
using Syncfusion.Pdf;
```

4. **Merge PDF files**: Use the following code snippet in `Program.cs` to merge PDF files:
Step 4: **Merge PDF files**: Use the following code snippet in `Program.cs` to merge PDF files:

```csharp
// Create a PDF document for the final merged output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ The Syncfusion [.NET Core PDF library](https://www.syncfusion.com/document-proce

Follow these steps to apply OCR to PDF files using the Syncfusion library:

1. **Create a new project**: Set up a new C# Console Application project.
Step 1: **Create a new project**: Set up a new C# Console Application project.

2. **Install the NuGet package**: Add the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) package as a reference in your project from [NuGet.org](https://www.nuget.org/).
Step 2: **Install the NuGet package**: Add the [Syncfusion.PDF.OCR.Net.Core](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core) package as a reference in your project from [NuGet.org](https://www.nuget.org/).

3. **Include necessary namespaces**: Add the following namespaces in your `Program.cs` file:
Step 3: **Include necessary namespaces**: Add the following namespaces in your `Program.cs` file:

```csharp
using Syncfusion.OCRProcessor;
using Syncfusion.Pdf.Parsing;
```

4. **Implement OCR Processing**: Use the following code snippet in `Program.cs` to perform OCR on a PDF document:
Step 4: **Implement OCR Processing**: Use the following code snippet in `Program.cs` to perform OCR on a PDF document:

```csharp
// Initialize the OCR processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@ void LoadedDocument_SubstituteFont(object sender, PdfFontEventArgs args)
}

//Close the document.
docStream.Dispose();
loadedDocument.Close(true);
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ The Syncfusion [.NET Core PDF library](https://www.syncfusion.com/document-proce

Follow these steps to convert a PDF document to PDF/A format using the Syncfusion library:

1. **Create a new project**: Start by creating a new C# Console Application project.
Step 1: **Create a new project**: Start by creating a new C# Console Application project.

2. **Install the NuGet package**: Reference the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package in your project from [NuGet.org](https://www.nuget.org/).
Step 2: **Install the NuGet package**: Reference the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package in your project from [NuGet.org](https://www.nuget.org/).

3. **Include necessary namespaces**: Add the following namespaces in your `Program.cs` file:
Step 3: **Include necessary namespaces**: Add the following namespaces in your `Program.cs` file:

```csharp
using Syncfusion.Pdf;
using Syncfusion.Pdf.Parsing;
```

4. **Convert PDF to PDF/A**: Implement the following code in `Program.cs` to perform the conversion:
Step 4: **Convert PDF to PDF/A**: Implement the following code in `Program.cs` to perform the conversion:

```csharp
// Load an existing PDF document
Expand All @@ -41,6 +41,6 @@ Follow these steps to convert a PDF document to PDF/A format using the Syncfusio
}
```

You can download a complete working sample from the [GitHub repository](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/PDF%20Conformance/Get-PDF-to-PDFA-conversion-progress/.NET).
You can download a complete working sample from the [GitHub repository](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/PDF%20Conformance/Convert-PDF-to-PDFA-conformance-document).

To explore additional features of the Syncfusion PDF library, click [here](https://www.syncfusion.com/document-processing/pdf-framework/net-core).
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@ The Syncfusion [.NET Core PDF library](https://www.syncfusion.com/document-proce

## Steps to split PDF files

1. **Create a new project**: Begin by setting up a new C# Console Application project.
Step 1: **Create a new project**: Begin by setting up a new C# Console Application project.

2. **Install the NuGet package**: Add the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package to your project from [NuGet.org](https://www.nuget.org/).
Step 2: **Install the NuGet package**: Add the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package to your project from [NuGet.org](https://www.nuget.org/).

3. **Include necessary namespaces**: In your **Program.cs** file, include the following namespaces:
Step 3: **Include necessary namespaces**: In your **Program.cs** file, include the following namespaces:

```csharp
using Syncfusion.Pdf.Parsing;
using Syncfusion.Pdf;
```

4. **Split the PDF file:** Implement the following code in **Program.cs** to split the PDF file:

```csharp
// Create a FileStream object to read the input PDF file
using (FileStream inputFileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
{
// Load the PDF document from the input stream
using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument(inputFileStream))
{
// Iterate over each page of the loaded document
for (int pageIndex = 0; pageIndex < loadedDocument.PageCount; pageIndex++)
{
```

Step 4: **Split the PDF file:** Implement the following code in **Program.cs** to split the PDF file:

```csharp
// Create a FileStream object to read the input PDF file
using (FileStream inputFileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
{
// Load the PDF document from the input stream
using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument(inputFileStream))
{
// Iterate over each page of the loaded document
for (int pageIndex = 0; pageIndex < loadedDocument.PageCount; pageIndex++)
{
// Create a new PdfDocument for the output
using (PdfDocument outputDocument = new PdfDocument())
{
// Import the page into the new document
outputDocument.ImportPage(loadedDocument, pageIndex);

// Create a FileStream to write the output PDF file
using (FileStream outputFileStream = new FileStream($"Output{pageIndex}.pdf", FileMode.Create, FileAccess.Write))
{
// Save the new document to the output stream
outputDocument.Save(outputFileStream);
}
// Import the page into the new document
outputDocument.ImportPage(loadedDocument, pageIndex);

// Create a FileStream to write the output PDF file
using (FileStream outputFileStream = new FileStream($"Output{pageIndex}.pdf", FileMode.Create, FileAccess.Write))
{
// Save the new document to the output stream
outputDocument.Save(outputFileStream);
}
}
}
}
}
```
}
}
}
```

You can download a complete working sample from [GitHub repository](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/Pages/Splitting-PDF-file-into-individual-pages/).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ The Syncfusion [.NET Core PDF library](https://www.syncfusion.com/document-proce

## Steps to Redact PDF Files

1. **Create a new project**: Start by creating a new C# Console Application project.
Step 1: **Create a new project**: Start by creating a new C# Console Application project.

2. **Install the NuGet package**: Add the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package to your project via [NuGet.org](https://www.nuget.org/).
Step 2: **Install the NuGet package**: Add the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package to your project via [NuGet.org](https://www.nuget.org/).

3. **Include necessary namespaces**: Add these namespaces to your **Program.cs** file:
Step 3: **Include necessary namespaces**: Add these namespaces to your **Program.cs** file:

```csharp
using Syncfusion.Pdf.Parsing;
Expand All @@ -17,7 +17,7 @@ The Syncfusion [.NET Core PDF library](https://www.syncfusion.com/document-proce
using Syncfusion.Drawing;
```

4. **Implement redaction**: Use the following code in **Program.cs** to perform PDF redaction:
Step 4: **Implement redaction**: Use the following code in **Program.cs** to perform PDF redaction:

```csharp
using (FileStream docStream = new FileStream(@"Input.pdf", FileMode.Open, FileAccess.Read))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ The Syncfusion [.NET Core PDF library](https://www.syncfusion.com/document-proce

## Steps to Protect PDF Files

1. **Create a new project**: Begin by setting up a new C# Console Application project.
Step 1: **Create a new project**: Begin by setting up a new C# Console Application project.

2. **Install the NuGet package**: Add the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package to your project from [NuGet.org](https://www.nuget.org/).
Step 2: **Install the NuGet package**: Add the [Syncfusion.Pdf.Net.Core](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/) package to your project from [NuGet.org](https://www.nuget.org/).

3. **Include necessary namespaces**: Add these namespaces in your **Program.cs** file:
Step 3: **Include necessary namespaces**: Add these namespaces in your **Program.cs** file:

```csharp
using Syncfusion.Pdf.Security;
using Syncfusion.Pdf.Parsing;
```

4. **Implement encryption**: Use the following code in **Program.cs** to secure your PDF file:
Step 4: **Implement encryption**: Use the following code in **Program.cs** to secure your PDF file:

```csharp
// Load the PDF document from a file stream
Expand Down
Loading

0 comments on commit ce8fa2e

Please sign in to comment.