From 923640102f8f6508bd4eeb7f8764bb6e1a28e33f Mon Sep 17 00:00:00 2001 From: VahidN Date: Tue, 19 Feb 2019 11:11:57 +0330 Subject: [PATCH] Added CurrentPageHeight to PdfWriter --- .../iTextSharp.LGPLv2.Core.FunctionalTests.csproj | 4 ++-- src/iTextSharp.LGPLv2.Core/_2-dotnet_build.bat | 2 +- .../iTextSharp.LGPLv2.Core.csproj | 14 +++++++------- .../iTextSharp/text/pdf/PdfDocument.cs | 4 ++-- .../iTextSharp/text/pdf/PdfWriter.cs | 5 +++++ tag-it.bat | 3 +++ update-dependencies.bat | 4 ++++ 7 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 tag-it.bat create mode 100644 update-dependencies.bat diff --git a/src/iTextSharp.LGPLv2.Core.FunctionalTests/iTextSharp.LGPLv2.Core.FunctionalTests.csproj b/src/iTextSharp.LGPLv2.Core.FunctionalTests/iTextSharp.LGPLv2.Core.FunctionalTests.csproj index eabff40..e41701b 100644 --- a/src/iTextSharp.LGPLv2.Core.FunctionalTests/iTextSharp.LGPLv2.Core.FunctionalTests.csproj +++ b/src/iTextSharp.LGPLv2.Core.FunctionalTests/iTextSharp.LGPLv2.Core.FunctionalTests.csproj @@ -16,8 +16,8 @@ - - + + diff --git a/src/iTextSharp.LGPLv2.Core/_2-dotnet_build.bat b/src/iTextSharp.LGPLv2.Core/_2-dotnet_build.bat index b4b0e75..6ba0ffb 100644 --- a/src/iTextSharp.LGPLv2.Core/_2-dotnet_build.bat +++ b/src/iTextSharp.LGPLv2.Core/_2-dotnet_build.bat @@ -1,2 +1,2 @@ -dotnet build +dotnet watch build pause \ No newline at end of file diff --git a/src/iTextSharp.LGPLv2.Core/iTextSharp.LGPLv2.Core.csproj b/src/iTextSharp.LGPLv2.Core/iTextSharp.LGPLv2.Core.csproj index f3804ca..d65d708 100644 --- a/src/iTextSharp.LGPLv2.Core/iTextSharp.LGPLv2.Core.csproj +++ b/src/iTextSharp.LGPLv2.Core/iTextSharp.LGPLv2.Core.csproj @@ -1,10 +1,10 @@  iTextSharp.LGPLv2.Core is an unofficial port of the last LGPL version of the iTextSharp (V4.1.6) to .NET Core. - 1.4.5 + 1.4.6 latest Vahid Nasiri - net40;netstandard1.3;netstandard2.0 + net40;netstandard1.3;netstandard2.0 $(NoWarn);1591 true iTextSharp.LGPLv2.Core @@ -28,7 +28,7 @@ - + @@ -36,14 +36,14 @@ - + NETSTANDARD1_3 - + @@ -51,13 +51,13 @@ - + NETSTANDARD2_0 - + NET40 diff --git a/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfDocument.cs b/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfDocument.cs index e893782..655c6e4 100644 --- a/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfDocument.cs +++ b/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfDocument.cs @@ -55,7 +55,7 @@ public class PdfDocument : Document /// /// This is the current height of the document. /// - protected internal float CurrentHeight; + public float CurrentHeight { get; private set; } /// /// This is the current PdfOutline in the hierarchy of outlines. @@ -2781,7 +2781,7 @@ protected internal void SetNewPageSizeAndMargins() PageSize = NextPageSize; if (MarginMirroring && (PageNumber & 1) == 0) { - RightMargin = NextMarginLeft; + RightMargin = NextMarginLeft; LeftMargin = NextMarginRight; } else diff --git a/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfWriter.cs b/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfWriter.cs index 6352af6..516b9d4 100644 --- a/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfWriter.cs +++ b/src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfWriter.cs @@ -755,6 +755,11 @@ protected PdfWriter(PdfDocument document, Stream os) : base(document, os) directContentUnder = new PdfContentByte(this); } + /// + /// This is the current height of the document. + /// + public float CurrentPageHeight => Pdf.CurrentHeight; + public PdfAcroForm AcroForm { get diff --git a/tag-it.bat b/tag-it.bat new file mode 100644 index 0000000..f787008 --- /dev/null +++ b/tag-it.bat @@ -0,0 +1,3 @@ +git tag -a 1.4.6 -m "Published 1.4.6 to nuget.org" +git push --follow-tags +pause \ No newline at end of file diff --git a/update-dependencies.bat b/update-dependencies.bat new file mode 100644 index 0000000..7783e14 --- /dev/null +++ b/update-dependencies.bat @@ -0,0 +1,4 @@ +dotnet tool update -g dotnet-outdated +dotnet outdated -u +dotnet restore +pause \ No newline at end of file