diff --git a/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font.sln b/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font.sln new file mode 100644 index 00000000..cbbfe320 --- /dev/null +++ b/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34723.18 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTML-to-PDF-Framework-Footer-Custom-Font", "HTML-to-PDF-Framework-Footer-Custom-Font\HTML-to-PDF-Framework-Footer-Custom-Font.csproj", "{DFF2E432-36D2-4AF2-8AA5-C715C9CF0773}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DFF2E432-36D2-4AF2-8AA5-C715C9CF0773}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DFF2E432-36D2-4AF2-8AA5-C715C9CF0773}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DFF2E432-36D2-4AF2-8AA5-C715C9CF0773}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DFF2E432-36D2-4AF2-8AA5-C715C9CF0773}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {FB1E6B03-346E-426C-84B6-45CC1A0277B0} + EndGlobalSection +EndGlobal diff --git a/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/App.config b/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/App.config new file mode 100644 index 00000000..a2d15d38 --- /dev/null +++ b/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/App.config @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /> + </startup> +</configuration> diff --git a/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/HTML-to-PDF-Framework-Footer-Custom-Font.csproj b/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/HTML-to-PDF-Framework-Footer-Custom-Font.csproj new file mode 100644 index 00000000..dd59204f --- /dev/null +++ b/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/HTML-to-PDF-Framework-Footer-Custom-Font.csproj @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{DFF2E432-36D2-4AF2-8AA5-C715C9CF0773}</ProjectGuid> + <OutputType>Exe</OutputType> + <RootNamespace>HTML_to_PDF_Framework_Footer_Custom_Font</RootNamespace> + <AssemblyName>HTML-to-PDF-Framework-Footer-Custom-Font</AssemblyName> + <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <Deterministic>true</Deterministic> + <NuGetPackageImportStamp> + </NuGetPackageImportStamp> + <TargetFrameworkProfile /> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <HintPath>..\packages\Newtonsoft.Json.13.0.2\lib\net45\Newtonsoft.Json.dll</HintPath> + </Reference> + <Reference Include="Syncfusion.Compression.Base, Version=27.1462.57.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL"> + <HintPath>..\packages\Syncfusion.Compression.Base.27.1.57\lib\net462\Syncfusion.Compression.Base.dll</HintPath> + </Reference> + <Reference Include="Syncfusion.HtmlConverter.Base, Version=27.1462.57.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL"> + <HintPath>..\packages\Syncfusion.HtmlToPdfConverter.WinForms.27.1.57\lib\net462\Syncfusion.HtmlConverter.Base.dll</HintPath> + </Reference> + <Reference Include="Syncfusion.Licensing, Version=27.1462.57.0, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL"> + <HintPath>..\packages\Syncfusion.Licensing.27.1.57\lib\net462\Syncfusion.Licensing.dll</HintPath> + </Reference> + <Reference Include="Syncfusion.Pdf.Base, Version=27.1462.57.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL"> + <HintPath>..\packages\Syncfusion.Pdf.WinForms.27.1.57\lib\net462\Syncfusion.Pdf.Base.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + <None Include="packages.config" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <Import Project="..\packages\Syncfusion.HtmlToPdfConverter.WinForms.27.1.57\build\net462\Syncfusion.HtmlToPdfConverter.WinForms.targets" Condition="Exists('..\packages\Syncfusion.HtmlToPdfConverter.WinForms.27.1.57\build\net462\Syncfusion.HtmlToPdfConverter.WinForms.targets')" /> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> + </PropertyGroup> + <Error Condition="!Exists('..\packages\Syncfusion.HtmlToPdfConverter.WinForms.27.1.57\build\net462\Syncfusion.HtmlToPdfConverter.WinForms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Syncfusion.HtmlToPdfConverter.WinForms.27.1.57\build\net462\Syncfusion.HtmlToPdfConverter.WinForms.targets'))" /> + </Target> +</Project> \ No newline at end of file diff --git a/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/Program.cs b/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/Program.cs new file mode 100644 index 00000000..0eb6b622 --- /dev/null +++ b/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/Program.cs @@ -0,0 +1,41 @@ +using System.Drawing; +using System.IO; +using Syncfusion.HtmlConverter; +using Syncfusion.Pdf; +using Syncfusion.Pdf.Graphics; + +namespace HTML_to_PDF_Framework_Footer_Custom_Font +{ + internal class Program + { + static void Main(string[] args) + { + HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(); + BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings(); + //Create font and brush for footer element. + PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 8); + PdfBrush brush = new PdfSolidBrush(Color.Black); + //Create PDF page template element for footer with bounds. + PdfPageTemplateElement footer = new PdfPageTemplateElement(new RectangleF(0, 0, blinkConverterSettings.PdfPageSize.Width, 50)); + //Create page number field. + PdfPageNumberField pageNumber = new PdfPageNumberField(font, PdfBrushes.Black); + //Create page count field. + PdfPageCountField count = new PdfPageCountField(font, PdfBrushes.Black); + //Add the fields in composite fields. + PdfCompositeField compositeField = new PdfCompositeField(font, PdfBrushes.Black, "Page {0} of {1}", pageNumber, count); + //Draw the composite field in footer + compositeField.Draw(footer.Graphics, PointF.Empty); + //Assign the footer element to PdfFooter of Blink converter settings. + blinkConverterSettings.PdfFooter = footer; + //Set Blink viewport size. + blinkConverterSettings.ViewPortSize = new Size(1024, 0); + htmlConverter.ConverterSettings = blinkConverterSettings; + //Convert URL to PDF. + PdfDocument document = htmlConverter.Convert("https://www.google.com/"); + //Save a PDF document to the file stream. + document.Save("Output.pdf"); + //Close the document. + document.Close(true); + } + } +} diff --git a/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/Properties/AssemblyInfo.cs b/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..7989a1b7 --- /dev/null +++ b/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("HTML-to-PDF-Framework-Footer-Custom-Font")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("HTML-to-PDF-Framework-Footer-Custom-Font")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("dff2e432-36d2-4af2-8aa5-c715c9cf0773")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/packages.config b/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/packages.config new file mode 100644 index 00000000..6a9722eb --- /dev/null +++ b/HTML to PDF/IE/HTML-to-PDF-Framework-Footer-Custom-Font/.NET-Framework/HTML-to-PDF-Framework-Footer-Custom-Font/packages.config @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="Newtonsoft.Json" version="13.0.2" targetFramework="net46" /> + <package id="Syncfusion.Compression.Base" version="27.1.57" targetFramework="net462" /> + <package id="Syncfusion.HtmlToPdfConverter.WinForms" version="27.1.57" targetFramework="net462" /> + <package id="Syncfusion.Licensing" version="27.1.57" targetFramework="net462" /> +</packages> \ No newline at end of file