Skip to content

Commit

Permalink
Added CurrentPageHeight to PdfWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
VahidN committed Feb 19, 2019
1 parent 22599ac commit 9236401
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
Expand Down
2 changes: 1 addition & 1 deletion src/iTextSharp.LGPLv2.Core/_2-dotnet_build.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dotnet build
dotnet watch build
pause
14 changes: 7 additions & 7 deletions src/iTextSharp.LGPLv2.Core/iTextSharp.LGPLv2.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description> iTextSharp.LGPLv2.Core is an unofficial port of the last LGPL version of the iTextSharp (V4.1.6) to .NET Core.</Description>
<VersionPrefix>1.4.5</VersionPrefix>
<VersionPrefix>1.4.6</VersionPrefix>
<LangVersion>latest</LangVersion>
<Authors>Vahid Nasiri</Authors>
<TargetFrameworks>net40;netstandard1.3;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net40;netstandard1.3;netstandard2.0</TargetFrameworks>
<NoWarn>$(NoWarn);1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>iTextSharp.LGPLv2.Core</AssemblyName>
Expand All @@ -28,36 +28,36 @@
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<PackageReference Include="CoreCompat.System.Drawing" Version="1.0.0-beta006" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.4" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.5" />
<PackageReference Include="System.Collections.NonGeneric" Version="4.3.0" />
<PackageReference Include="System.Net.Requests" Version="4.3.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.5.1" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="System.Security.Cryptography.Algorithms" Version="4.3.1" />
<PackageReference Include="System.Xml.ReaderWriter" Version="4.3.1" />
<PackageReference Include="System.Xml.XmlDocument" Version="4.3.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
<DefineConstants>NETSTANDARD1_3</DefineConstants>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Drawing.Common" Version="4.5.1" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.4" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.5" />
<PackageReference Include="System.Collections.NonGeneric" Version="4.3.0" />
<PackageReference Include="System.Net.Requests" Version="4.3.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.5.1" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="System.Security.Cryptography.Algorithms" Version="4.3.1" />
<PackageReference Include="System.Xml.ReaderWriter" Version="4.3.1" />
<PackageReference Include="System.Xml.XmlDocument" Version="4.3.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>NETSTANDARD2_0</DefineConstants>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
<PackageReference Include="Portable.BouncyCastle" Version="1.8.4" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.5" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net40'">
<DefineConstants>NET40</DefineConstants>
Expand Down
4 changes: 2 additions & 2 deletions src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class PdfDocument : Document
/// <summary>
/// This is the current height of the document.
/// </summary>
protected internal float CurrentHeight;
public float CurrentHeight { get; private set; }

/// <summary>
/// This is the current PdfOutline in the hierarchy of outlines.
Expand Down Expand Up @@ -2781,7 +2781,7 @@ protected internal void SetNewPageSizeAndMargins()
PageSize = NextPageSize;
if (MarginMirroring && (PageNumber & 1) == 0)
{
RightMargin = NextMarginLeft;
RightMargin = NextMarginLeft;
LeftMargin = NextMarginRight;
}
else
Expand Down
5 changes: 5 additions & 0 deletions src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,11 @@ protected PdfWriter(PdfDocument document, Stream os) : base(document, os)
directContentUnder = new PdfContentByte(this);
}

/// <summary>
/// This is the current height of the document.
/// </summary>
public float CurrentPageHeight => Pdf.CurrentHeight;

public PdfAcroForm AcroForm
{
get
Expand Down
3 changes: 3 additions & 0 deletions tag-it.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
git tag -a 1.4.6 -m "Published 1.4.6 to nuget.org"
git push --follow-tags
pause
4 changes: 4 additions & 0 deletions update-dependencies.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dotnet tool update -g dotnet-outdated
dotnet outdated -u
dotnet restore
pause

0 comments on commit 9236401

Please sign in to comment.