-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
927950 Added new feature sample code
- Loading branch information
1 parent
86f86cc
commit dcb602d
Showing
29 changed files
with
5,118 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...tion/Flatten-specific-types-of-annotations/.NET/Flatten-specific-types-of-annotations.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.12.35527.113 d17.12 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flatten-specific-types-of-annotations", "Flatten-specific-types-of-annotations\Flatten-specific-types-of-annotations.csproj", "{469F054C-9D3B-4B46-8623-229B66CBCB6C}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{469F054C-9D3B-4B46-8623-229B66CBCB6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{469F054C-9D3B-4B46-8623-229B66CBCB6C}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{469F054C-9D3B-4B46-8623-229B66CBCB6C}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{469F054C-9D3B-4B46-8623-229B66CBCB6C}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
Binary file added
BIN
+36.2 KB
...n-specific-types-of-annotations/.NET/Flatten-specific-types-of-annotations/Data/Input.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
...s/.NET/Flatten-specific-types-of-annotations/Flatten-specific-types-of-annotations.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>Flatten_specific_types_of_annotations</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="*" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Empty file.
25 changes: 25 additions & 0 deletions
25
...atten-specific-types-of-annotations/.NET/Flatten-specific-types-of-annotations/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Syncfusion.Pdf.Interactive; | ||
using Syncfusion.Pdf.Parsing; | ||
|
||
//Load the PDF document using a file stream | ||
using (FileStream docStream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.Read)) | ||
{ | ||
//Load the existing PDF document | ||
using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream)) | ||
{ | ||
//Specify the annotation types to flatten | ||
PdfLoadedAnnotationType[] pdfLoadedAnnotationTypes = new PdfLoadedAnnotationType[] | ||
{ | ||
PdfLoadedAnnotationType.PolygonAnnotation | ||
}; | ||
|
||
//Flatten the selected annotations | ||
loadedDocument.FlattenAnnotations(pdfLoadedAnnotationTypes); | ||
|
||
//Save the flattened document using a file stream | ||
using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output\Output.pdf"), FileMode.Create, FileAccess.Write)) | ||
{ | ||
loadedDocument.Save(outputStream); | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
.../Set-text-alignment-in-a-Combo-Box-field/.NET/Set-text-alignment-in-a-Combo-Box-field.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.12.35527.113 d17.12 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Set-text-alignment-in-a-Combo-Box-field", "Set-text-alignment-in-a-Combo-Box-field\Set-text-alignment-in-a-Combo-Box-field.csproj", "{724C50AC-603C-4E24-BBA5-17784D364091}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{724C50AC-603C-4E24-BBA5-17784D364091}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{724C50AC-603C-4E24-BBA5-17784D364091}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{724C50AC-603C-4E24-BBA5-17784D364091}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{724C50AC-603C-4E24-BBA5-17784D364091}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
Binary file added
BIN
+5.59 KB
...lignment-in-a-Combo-Box-field/.NET/Set-text-alignment-in-a-Combo-Box-field/Data/Input.pdf
Binary file not shown.
Empty file.
20 changes: 20 additions & 0 deletions
20
...xt-alignment-in-a-Combo-Box-field/.NET/Set-text-alignment-in-a-Combo-Box-field/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Syncfusion.Pdf.Graphics; | ||
using Syncfusion.Pdf.Parsing; | ||
|
||
// Load an existing document from a file stream. | ||
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Data\Input.pdf"), FileMode.Open, FileAccess.Read)) | ||
{ | ||
PdfLoadedDocument doc = new PdfLoadedDocument(fileStream); | ||
// Load an existing combo box field by its name. | ||
PdfLoadedComboBoxField comboField = doc.Form.Fields["JobTitle"] as PdfLoadedComboBoxField; | ||
// Set text alignment to center for the combo box field. | ||
comboField.TextAlignment = PdfTextAlignment.Center; | ||
|
||
// Save the updated document to a file stream. | ||
using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output\Output.pdf"), FileMode.Create, FileAccess.Write)) | ||
{ | ||
doc.Save(outputStream); | ||
} | ||
// Close the document. | ||
doc.Close(true); | ||
} |
15 changes: 15 additions & 0 deletions
15
...ET/Set-text-alignment-in-a-Combo-Box-field/Set-text-alignment-in-a-Combo-Box-field.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>Set_text_alignment_in_a_Combo_Box_field</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="*" /> | ||
</ItemGroup> | ||
|
||
</Project> |
22 changes: 22 additions & 0 deletions
22
Digital Signature/Customize-the-signed-date/.NET/Customize-the-signed-date.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.12.35527.113 d17.12 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Customize-the-signed-date", "Customize-the-signed-date\Customize-the-signed-date.csproj", "{5DC85BA0-2790-4226-81A1-438185A892E5}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{5DC85BA0-2790-4226-81A1-438185A892E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{5DC85BA0-2790-4226-81A1-438185A892E5}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{5DC85BA0-2790-4226-81A1-438185A892E5}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{5DC85BA0-2790-4226-81A1-438185A892E5}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
15 changes: 15 additions & 0 deletions
15
...Customize-the-signed-date/.NET/Customize-the-signed-date/Customize-the-signed-date.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>Customize_the_signed_date</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="*" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Empty file.
23 changes: 23 additions & 0 deletions
23
Digital Signature/Customize-the-signed-date/.NET/Customize-the-signed-date/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Syncfusion.Pdf; | ||
using Syncfusion.Pdf.Security; | ||
using Syncfusion.Drawing; | ||
|
||
//Create a new PDF document instance. | ||
PdfDocument document = new PdfDocument(); | ||
//Add a new page to the PDF document. | ||
PdfPage page = document.Pages.Add(); | ||
//Create a digital signature and associate it with the added page. | ||
PdfSignature signature = new PdfSignature(page, "Signature", new DateTime(2020, 12, 24, 10, 50, 10)); | ||
//Set the timestamp server for the digital signature. | ||
signature.TimeStampServer = new TimeStampServer(new Uri("http://timestamp.digicert.com")); | ||
//Set the signed name for the signature. | ||
signature.SignedName = "Test"; | ||
//Define the bounds for the signature (position and size on the page). | ||
signature.Bounds = new RectangleF(new PointF(0, 0), new SizeF(200, 100)); | ||
//Save the document to a file using a file stream. | ||
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output\Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) | ||
{ | ||
document.Save(fileStream); | ||
} | ||
//Close the document to release resources. | ||
document.Close(true); |
22 changes: 22 additions & 0 deletions
22
HTML to PDF/Blink/Get-Bounds-in-HTML-file/.NET/Get-Bounds-in-HTML-file.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.12.35527.113 d17.12 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Get-Bounds-in-HTML-file", "Get-Bounds-in-HTML-file\Get-Bounds-in-HTML-file.csproj", "{C675E325-B7B0-40DF-B29C-FB152C83EF0E}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{C675E325-B7B0-40DF-B29C-FB152C83EF0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{C675E325-B7B0-40DF-B29C-FB152C83EF0E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{C675E325-B7B0-40DF-B29C-FB152C83EF0E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{C675E325-B7B0-40DF-B29C-FB152C83EF0E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
22 changes: 22 additions & 0 deletions
22
HTML to PDF/Blink/Get-Bounds-in-HTML-file/.NET/Get-Bounds-in-HTML-file/Data/Input.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>10 Lines of Paragraph</title> | ||
</head> | ||
<body> | ||
<p> | ||
Line 1: This is the first line of the paragraph.<br> | ||
Line 2: Here comes the second line.<br> | ||
Line 3: Continuing with the third line.<br> | ||
Line 4: Fourth line is also important.<br> | ||
Line 5: Now, we reach the halfway point.<br> | ||
Line 6: The sixth line brings more information.<br> | ||
Line 7: Moving on to the seventh line.<br> | ||
Line 8: Eighth line follows closely behind.<br> | ||
Line 9: We're almost done with the ninth line.<br> | ||
Line 10: Finally, this is the tenth and last line of the paragraph. | ||
</p> | ||
</body> | ||
</html> |
15 changes: 15 additions & 0 deletions
15
...Blink/Get-Bounds-in-HTML-file/.NET/Get-Bounds-in-HTML-file/Get-Bounds-in-HTML-file.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>Get_Bounds_in_HTML_file</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.HtmlToPdfConverter.Net.Windows" Version="*" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Empty file.
17 changes: 17 additions & 0 deletions
17
HTML to PDF/Blink/Get-Bounds-in-HTML-file/.NET/Get-Bounds-in-HTML-file/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Syncfusion.Drawing; | ||
using Syncfusion.HtmlConverter; | ||
|
||
// Initialize HTML to PDF converter | ||
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(); | ||
// Initialize Blink converter settings | ||
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings(); | ||
|
||
// Set the crop region for the HTML conversion based on the bounds of the HTML file | ||
blinkConverterSettings.CropRegion = htmlConverter.GetHtmlBounds(Path.GetFullPath(@"Data\Input.html")); | ||
|
||
// Assign Blink converter settings to the HTML converter | ||
htmlConverter.ConverterSettings = blinkConverterSettings; | ||
// Convert the HTML file to an image | ||
Image image = htmlConverter.ConvertToImage(Path.GetFullPath(@"Data\Input.html")); | ||
// Save the image as a PNG file | ||
File.WriteAllBytes(Path.GetFullPath(@"Output\Output.png"), image.ImageData); |
22 changes: 22 additions & 0 deletions
22
HTML to PDF/Blink/HTML-to-PDF-Enable-Autoscaling/.NET/HTML-to-PDF-Enable-Autoscaling.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.12.35527.113 d17.12 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTML-to-PDF-Enable-Autoscaling", "HTML-to-PDF-Enable-Autoscaling\HTML-to-PDF-Enable-Autoscaling.csproj", "{0C431F60-9A1D-4ECA-BF9C-FC3CD6D9F239}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{0C431F60-9A1D-4ECA-BF9C-FC3CD6D9F239}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{0C431F60-9A1D-4ECA-BF9C-FC3CD6D9F239}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{0C431F60-9A1D-4ECA-BF9C-FC3CD6D9F239}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{0C431F60-9A1D-4ECA-BF9C-FC3CD6D9F239}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
Oops, something went wrong.