Skip to content

Commit

Permalink
WF-63149 Update sample for working with document
Browse files Browse the repository at this point in the history
  • Loading branch information
SowmiyaLoganathan committed Jul 13, 2022
1 parent 8f87a35 commit e961557
Show file tree
Hide file tree
Showing 72 changed files with 1,693 additions and 2 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}") = "Add_BaseUri_in_the_PDF_document", "Add_BaseUri_in_the_PDF_document\Add_BaseUri_in_the_PDF_document.csproj", "{B027B9B2-4DBB-4DDA-97E7-1BDE942A0911}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B027B9B2-4DBB-4DDA-97E7-1BDE942A0911}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B027B9B2-4DBB-4DDA-97E7-1BDE942A0911}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B027B9B2-4DBB-4DDA-97E7-1BDE942A0911}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B027B9B2-4DBB-4DDA-97E7-1BDE942A0911}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {21E935CC-6F39-4988-BC44-1E33EB9FF54A}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.Pdf.NET" Version="20.1.0.50" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Pdf;

//Create a new instance of the PdfDocument class.
PdfDocument document = new PdfDocument();

//Set the Base URI.
document.BaseUri = "https://www.syncfusion.com/";

//Create a new page.
PdfPage page = document.Pages.Add();

//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}") = "Add_PDF_document_properties", "Add_PDF_document_properties\Add_PDF_document_properties.csproj", "{B858A7F3-45D6-433C-BEB7-EE6E68FBC961}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B858A7F3-45D6-433C-BEB7-EE6E68FBC961}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B858A7F3-45D6-433C-BEB7-EE6E68FBC961}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B858A7F3-45D6-433C-BEB7-EE6E68FBC961}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B858A7F3-45D6-433C-BEB7-EE6E68FBC961}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BE8AB7B4-9FD9-4015-8E23-F898944F3537}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.Pdf.NET" Version="20.1.0.50" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// 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();

//Set document information.
document.DocumentInformation.Author = "Syncfusion";
document.DocumentInformation.CreationDate = DateTime.Now;
document.DocumentInformation.Creator = "Essential PDF";
document.DocumentInformation.Keywords = "PDF";
document.DocumentInformation.Subject = "Document information DEMO";
document.DocumentInformation.Title = "Essential PDF Sample";

//Add a page to the document.
PdfPage page = document.Pages.Add();

//Create PDF graphics for the page.
PdfGraphics graphics = page.Graphics;

//Set the font.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 20);

//Draw text to the page.
graphics.DrawString("Hello World!!!", font, PdfBrushes.Black, new PointF(0, 0));

//Save the document.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
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}") = "Change-the-page-orientation-from-portrait-to-landscape", "Change-the-page-orientation-from-portrait-to-landscape\Change-the-page-orientation-from-portrait-to-landscape.csproj", "{A2C30CB6-DF26-43BA-B648-8F009D73AD23}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A2C30CB6-DF26-43BA-B648-8F009D73AD23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A2C30CB6-DF26-43BA-B648-8F009D73AD23}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2C30CB6-DF26-43BA-B648-8F009D73AD23}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2C30CB6-DF26-43BA-B648-8F009D73AD23}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B16181A6-6594-48A5-881A-2A370D34FA5A}
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>Change_the_page_orientation_from_portrait_to_landscape</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.Pdf.NET" Version="20.2.0.36" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// See https://aka.ms/new-console-template for more information

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

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

//Set the page size.
document.PageSettings.Size = PdfPageSize.A4;

//Change the page orientation to landscape.
document.PageSettings.Orientation = PdfPageOrientation.Landscape;

//Add a page to the document.
PdfPage page = document.Pages.Add();

//Create PDF graphics for the page.
PdfGraphics graphics = page.Graphics;

//Set the font.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 20);

//Draw the text in PDF page.
graphics.DrawString("Hello World!!!", font, PdfBrushes.Black, new Syncfusion.Drawing.PointF(0, 0));

//Create file stream for output PDF document.
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}") = "Change_existing_PDF_properties", "Change_existing_PDF_properties\Change_existing_PDF_properties.csproj", "{30B4429C-B570-4796-886E-417316265204}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{30B4429C-B570-4796-886E-417316265204}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{30B4429C-B570-4796-886E-417316265204}.Debug|Any CPU.Build.0 = Debug|Any CPU
{30B4429C-B570-4796-886E-417316265204}.Release|Any CPU.ActiveCfg = Release|Any CPU
{30B4429C-B570-4796-886E-417316265204}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E12FAAD4-12F7-4DBA-89AA-58C97B38CD2B}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.Pdf.NET" Version="20.1.0.50" />
</ItemGroup>

</Project>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Pdf.Parsing;

//Get stream from an existing PDF document.
FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"../../../Input.pdf"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);

//Load the PDF document.
PdfLoadedDocument document = new PdfLoadedDocument(fileStreamPath);

//Modify the document information.
document.DocumentInformation.Author = "Syncfusion";
document.DocumentInformation.CreationDate = DateTime.Now;
document.DocumentInformation.Creator = "Essential PDF";
document.DocumentInformation.Keywords = "PDF";
document.DocumentInformation.Subject = "Document information DEMO";
document.DocumentInformation.Title = "Essential PDF Sample";
document.DocumentInformation.ModificationDate = DateTime.Now;
document.DocumentInformation.Producer = "Syncfusion PDF";

//Create file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document.
document.Save(outputFileStream);
}

//Closes the PDF 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}") = "Create-PDF-with-display-of-specific-panel", "Create-PDF-with-display-of-specific-panel\Create-PDF-with-display-of-specific-panel.csproj", "{6265E0D0-3746-4BDE-B01F-E9B87F38DB44}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6265E0D0-3746-4BDE-B01F-E9B87F38DB44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6265E0D0-3746-4BDE-B01F-E9B87F38DB44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6265E0D0-3746-4BDE-B01F-E9B87F38DB44}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6265E0D0-3746-4BDE-B01F-E9B87F38DB44}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6B7F6381-9AE3-4077-9BB7-118C710D74F0}
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>Create_PDF_with_display_of_specific_panel</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.Pdf.NET" Version="20.2.0.36" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// See https://aka.ms/new-console-template for more information

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;

//Set the font.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 20);

//Draw the text.
graphics.DrawString("Hello World!!!", font, PdfBrushes.Black, new Syncfusion.Drawing.PointF(0, 0));

//Show the attachments panel.
document.ViewerPreferences.PageMode = PdfPageMode.UseAttachments;

//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}") = "Create-a-PDF-document-with-custom-page-size", "Create-a-PDF-document-with-custom-page-size\Create-a-PDF-document-with-custom-page-size.csproj", "{2B8F4238-8965-4318-BADF-ED73273A33B6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2B8F4238-8965-4318-BADF-ED73273A33B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B8F4238-8965-4318-BADF-ED73273A33B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B8F4238-8965-4318-BADF-ED73273A33B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B8F4238-8965-4318-BADF-ED73273A33B6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5CF83D2A-7E85-4146-A893-EFDE822C6C2F}
EndGlobalSection
EndGlobal
Loading

0 comments on commit e961557

Please sign in to comment.