Skip to content

Commit

Permalink
WF-63205 Update sample for "Working with Pages", "Working with Text",…
Browse files Browse the repository at this point in the history
… "Working with Images" and "Working with Brushes"
  • Loading branch information
SowmiyaLoganathan committed Jul 21, 2022
1 parent fa18613 commit cded030
Show file tree
Hide file tree
Showing 194 changed files with 4,441 additions and 0 deletions.
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
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>
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);
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
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>
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);
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
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>
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);
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
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>
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 Images/Add-a-mask-to-TIFF-image/.NET/Add-a-mask-to-TIFF-image.sln
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
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 not shown.
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 not shown.
Loading

0 comments on commit cded030

Please sign in to comment.