-
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.
WF-63205 Update sample for "Working with Pages", "Working with Text",…
… "Working with Images" and "Working with Brushes"
- Loading branch information
1 parent
fa18613
commit cded030
Showing
194 changed files
with
4,441 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
Brushes/Draw-shape-on-PDF-with-tiling-brush/.NET/Draw-shape-on-PDF-with-tiling-brush.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,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.1.32407.343 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Draw-shape-on-PDF-with-tiling-brush", "Draw-shape-on-PDF-with-tiling-brush\Draw-shape-on-PDF-with-tiling-brush.csproj", "{103411CA-A262-4362-963B-D97D75BB9115}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{103411CA-A262-4362-963B-D97D75BB9115}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{103411CA-A262-4362-963B-D97D75BB9115}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{103411CA-A262-4362-963B-D97D75BB9115}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{103411CA-A262-4362-963B-D97D75BB9115}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {914CD547-A83F-4F58-9B10-6DDF4029AABF} | ||
EndGlobalSection | ||
EndGlobal |
15 changes: 15 additions & 0 deletions
15
...brush/.NET/Draw-shape-on-PDF-with-tiling-brush/Draw-shape-on-PDF-with-tiling-brush.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>net6.0</TargetFramework> | ||
<RootNamespace>Draw_shape_on_PDF_with_tiling_brush</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.Pdf.NET" Version="20.1.0.51" /> | ||
</ItemGroup> | ||
|
||
</Project> |
33 changes: 33 additions & 0 deletions
33
...s/Draw-shape-on-PDF-with-tiling-brush/.NET/Draw-shape-on-PDF-with-tiling-brush/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,33 @@ | ||
// See https://aka.ms/new-console-template for more information | ||
|
||
using Syncfusion.Drawing; | ||
using Syncfusion.Pdf; | ||
using Syncfusion.Pdf.Graphics; | ||
|
||
//Create a new PDF document. | ||
PdfDocument document = new PdfDocument(); | ||
|
||
//Add a page to the document. | ||
PdfPage page = document.Pages.Add(); | ||
|
||
//Create PDF graphics for the page. | ||
PdfGraphics graphics = page.Graphics; | ||
|
||
//Create new PDF tiling brush. | ||
PdfTilingBrush brush = new PdfTilingBrush(new RectangleF(0, 0, 11, 11)); | ||
|
||
//Draw ellipse inside the tile. | ||
brush.Graphics.DrawEllipse(PdfPens.Red, new RectangleF(0, 0, 10, 10)); | ||
|
||
//Draw ellipse. | ||
graphics.DrawEllipse(brush, new RectangleF(0, 0, 200, 100)); | ||
|
||
//Create file stream. | ||
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) | ||
{ | ||
//Save the PDF document to file stream. | ||
document.Save(outputFileStream); | ||
} | ||
|
||
//Close the document. | ||
document.Close(true); |
25 changes: 25 additions & 0 deletions
25
...-on-PDF-with-radial-gradient-brush/.NET/Draw-shapes-on-PDF-with-radial-gradient-brush.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,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.1.32407.343 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Draw-shapes-on-PDF-with-radial-gradient-brush", "Draw-shapes-on-PDF-with-radial-gradient-brush\Draw-shapes-on-PDF-with-radial-gradient-brush.csproj", "{CE02AF57-2101-4600-8A77-C84692264ABE}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{CE02AF57-2101-4600-8A77-C84692264ABE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{CE02AF57-2101-4600-8A77-C84692264ABE}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{CE02AF57-2101-4600-8A77-C84692264ABE}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{CE02AF57-2101-4600-8A77-C84692264ABE}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {119651CF-A4AA-44B3-8492-644EA44B597C} | ||
EndGlobalSection | ||
EndGlobal |
15 changes: 15 additions & 0 deletions
15
...es-on-PDF-with-radial-gradient-brush/Draw-shapes-on-PDF-with-radial-gradient-brush.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>net6.0</TargetFramework> | ||
<RootNamespace>Draw_shapes_on_PDF_with_radial_gradient_brush</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.Pdf.NET" Version="20.1.0.51" /> | ||
</ItemGroup> | ||
|
||
</Project> |
30 changes: 30 additions & 0 deletions
30
...-with-radial-gradient-brush/.NET/Draw-shapes-on-PDF-with-radial-gradient-brush/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,30 @@ | ||
// See https://aka.ms/new-console-template for more information | ||
|
||
using Syncfusion.Drawing; | ||
using Syncfusion.Pdf; | ||
using Syncfusion.Pdf.Graphics; | ||
|
||
//Create a new PDF document. | ||
PdfDocument document = new PdfDocument(); | ||
|
||
//Add a page to the document. | ||
PdfPage page = document.Pages.Add(); | ||
|
||
//Create PDF graphics for the page. | ||
PdfGraphics graphics = page.Graphics; | ||
|
||
//Create new PDF radial gradient brush. | ||
PdfRadialGradientBrush brush = new PdfRadialGradientBrush(new PointF(50, 50), 0, new PointF(50, 50), 50, Color.Red, Color.Blue); | ||
|
||
//Draw ellipse on the page. | ||
graphics.DrawEllipse(brush, new RectangleF(0, 0, 100, 100)); | ||
|
||
//Create file stream. | ||
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) | ||
{ | ||
//Save the PDF document to file stream. | ||
document.Save(outputFileStream); | ||
} | ||
|
||
//Close the document. | ||
document.Close(true); |
25 changes: 25 additions & 0 deletions
25
...-object-with-gradient-brush-in-a-PDF/.NET/Fill-an-object-with-gradient-brush-in-a-PDF.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,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.1.32407.343 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fill-an-object-with-gradient-brush-in-a-PDF", "Fill-an-object-with-gradient-brush-in-a-PDF\Fill-an-object-with-gradient-brush-in-a-PDF.csproj", "{73E58804-F26A-46EE-8FB3-BFB4CE620B23}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{73E58804-F26A-46EE-8FB3-BFB4CE620B23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{73E58804-F26A-46EE-8FB3-BFB4CE620B23}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{73E58804-F26A-46EE-8FB3-BFB4CE620B23}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{73E58804-F26A-46EE-8FB3-BFB4CE620B23}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {512AF057-0616-48F4-B849-3D6BE3789514} | ||
EndGlobalSection | ||
EndGlobal |
15 changes: 15 additions & 0 deletions
15
...an-object-with-gradient-brush-in-a-PDF/Fill-an-object-with-gradient-brush-in-a-PDF.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>net6.0</TargetFramework> | ||
<RootNamespace>Fill_an_object_with_gradient_brush_in_a_PDF</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.Pdf.NET" Version="20.1.0.51" /> | ||
</ItemGroup> | ||
|
||
</Project> |
30 changes: 30 additions & 0 deletions
30
...-with-gradient-brush-in-a-PDF/.NET/Fill-an-object-with-gradient-brush-in-a-PDF/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,30 @@ | ||
// See https://aka.ms/new-console-template for more information | ||
|
||
using Syncfusion.Drawing; | ||
using Syncfusion.Pdf; | ||
using Syncfusion.Pdf.Graphics; | ||
|
||
//Create a new PDF document. | ||
PdfDocument document = new PdfDocument(); | ||
|
||
//Add a page to the document. | ||
PdfPage page = document.Pages.Add(); | ||
|
||
//Create PDF graphics for the page. | ||
PdfGraphics graphics = page.Graphics; | ||
|
||
//Create new PDF linear gradient brush. | ||
PdfLinearGradientBrush brush = new PdfLinearGradientBrush(new PointF(0, 0), new PointF(200, 100), Color.Red, Color.Blue); | ||
|
||
//Draw ellipse on the page. | ||
graphics.DrawEllipse(brush, new RectangleF(0, 0, 200, 100)); | ||
|
||
//Create file stream. | ||
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) | ||
{ | ||
//Save the PDF document to file stream. | ||
document.Save(outputFileStream); | ||
} | ||
|
||
//Close the document. | ||
document.Close(true); |
25 changes: 25 additions & 0 deletions
25
...ill-an-object-with-solid-brush-in-a-PDF/.NET/Fill-an-object-with-solid-brush-in-a-PDF.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,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.1.32407.343 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fill-an-object-with-solid-brush-in-a-PDF", "Fill-an-object-with-solid-brush-in-a-PDF\Fill-an-object-with-solid-brush-in-a-PDF.csproj", "{F3BDCB94-CC6C-4CB1-B328-654F62D70369}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{F3BDCB94-CC6C-4CB1-B328-654F62D70369}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{F3BDCB94-CC6C-4CB1-B328-654F62D70369}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{F3BDCB94-CC6C-4CB1-B328-654F62D70369}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{F3BDCB94-CC6C-4CB1-B328-654F62D70369}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {4EFEB27F-23D2-44D9-938F-B9C461687113} | ||
EndGlobalSection | ||
EndGlobal |
15 changes: 15 additions & 0 deletions
15
.../Fill-an-object-with-solid-brush-in-a-PDF/Fill-an-object-with-solid-brush-in-a-PDF.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>net6.0</TargetFramework> | ||
<RootNamespace>Fill_an_object_with_solid_brush_in_a_PDF</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.Pdf.NET" Version="20.1.0.51" /> | ||
</ItemGroup> | ||
|
||
</Project> |
30 changes: 30 additions & 0 deletions
30
...object-with-solid-brush-in-a-PDF/.NET/Fill-an-object-with-solid-brush-in-a-PDF/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,30 @@ | ||
// See https://aka.ms/new-console-template for more information | ||
|
||
using Syncfusion.Drawing; | ||
using Syncfusion.Pdf; | ||
using Syncfusion.Pdf.Graphics; | ||
|
||
//Create a new PDF document. | ||
PdfDocument document = new PdfDocument(); | ||
|
||
//Add a page to the document. | ||
PdfPage page = document.Pages.Add(); | ||
|
||
//Create PDF graphics for the page. | ||
PdfGraphics graphics = page.Graphics; | ||
|
||
//Create new PDF solid brush. | ||
PdfSolidBrush brush = new PdfSolidBrush(Color.Red); | ||
|
||
//Draw ellipse on the page. | ||
graphics.DrawEllipse(brush, new RectangleF(0, 0, 200, 100)); | ||
|
||
//Create file stream. | ||
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) | ||
{ | ||
//Save the PDF document to file stream. | ||
document.Save(outputFileStream); | ||
} | ||
|
||
//Close the document. | ||
document.Close(true); |
25 changes: 25 additions & 0 deletions
25
Images/Add-a-mask-to-TIFF-image/.NET/Add-a-mask-to-TIFF-image.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,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.1.32407.343 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Add-a-mask-to-TIFF-image", "Add-a-mask-to-TIFF-image\Add-a-mask-to-TIFF-image.csproj", "{37B24FF3-EA4E-445C-9DBC-6074CC9B4B9B}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{37B24FF3-EA4E-445C-9DBC-6074CC9B4B9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{37B24FF3-EA4E-445C-9DBC-6074CC9B4B9B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{37B24FF3-EA4E-445C-9DBC-6074CC9B4B9B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{37B24FF3-EA4E-445C-9DBC-6074CC9B4B9B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {DC0E78C8-5C4F-45D1-95E5-0B49F29E3035} | ||
EndGlobalSection | ||
EndGlobal |
15 changes: 15 additions & 0 deletions
15
...es/Add-a-mask-to-TIFF-image/.NET/Add-a-mask-to-TIFF-image/Add-a-mask-to-TIFF-image.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>net6.0</TargetFramework> | ||
<RootNamespace>Add_a_mask_to_TIFF_image</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Syncfusion.Pdf.Imaging.Net.Core" Version="20.1.0.51" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Binary file added
BIN
+190 KB
Images/Add-a-mask-to-TIFF-image/.NET/Add-a-mask-to-TIFF-image/Image.tif
Binary file not shown.
42 changes: 42 additions & 0 deletions
42
Images/Add-a-mask-to-TIFF-image/.NET/Add-a-mask-to-TIFF-image/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,42 @@ | ||
// See https://aka.ms/new-console-template for more information | ||
|
||
using Syncfusion.Pdf; | ||
using Syncfusion.Pdf.Graphics; | ||
|
||
//Create a PDF document. | ||
PdfDocument document = new PdfDocument(); | ||
|
||
//Add pages to the document. | ||
PdfPage page = document.Pages.Add(); | ||
|
||
//Create PDF graphics for the page. | ||
PdfGraphics graphics = page.Graphics; | ||
|
||
//Get stream from the existing TIF file. | ||
FileStream imageStream = new FileStream(Path.GetFullPath("../../../image.tif"), FileMode.Open, FileAccess.Read); | ||
|
||
//Load the image from stream. | ||
PdfTiffImage image = new PdfTiffImage(imageStream); | ||
|
||
//Get stream from the image file. | ||
FileStream maskStream = new FileStream(Path.GetFullPath("../../../mask2.bmp"), FileMode.Open, FileAccess.Read); | ||
|
||
//Load the image mask file from stream. | ||
PdfImageMask mask = new PdfImageMask(new PdfTiffImage(maskStream)); | ||
|
||
//Assign the masking image to TIF image. | ||
image.Mask = mask; | ||
|
||
//Draw the image. | ||
graphics.DrawImage(image, 0, 0); | ||
|
||
//Create file stream. | ||
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) | ||
{ | ||
//Save the PDF document to file stream | ||
document.Save(outputFileStream); | ||
} | ||
|
||
//Close the document | ||
document.Close(true); | ||
|
Binary file added
BIN
+65.1 KB
Images/Add-a-mask-to-TIFF-image/.NET/Add-a-mask-to-TIFF-image/mask2.bmp
Binary file not shown.
Oops, something went wrong.