Compare commits

...

5 Commits

Author SHA1 Message Date
04b3d630fe update to ignore appsettings.migration.json 2025-09-29 16:45:55 +02:00
d39a3d283d bump to 3.4.1 2025-09-29 16:18:51 +02:00
7cae9a5291 feat(pdf): add overload for Page to apply design across all pages
- Introduced Page(Action<PdfPage>) method to apply design logic to every page in the document
- Simplified Background method by replacing per-page iteration with new Page overload
- Improved readability and maintainability by removing duplicate page loop logic
2025-09-29 15:43:55 +02:00
6f31d7b1d0 refactor(pdf): optimize background rendering with single concat per page
- Added `System.Linq` import to enable distinct and ordered page index selection
- Applied `ConcatMatrix` transformation once per page instead of per signature
- Improved performance and reduced redundant operations in `Background` method
2025-09-29 15:06:24 +02:00
06431028cb refactor(EnvelopeLocked): add if smsExpiration-statetment to timer script 2025-09-29 14:04:24 +02:00
4 changed files with 25 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ using iText.Kernel.Geom;
#if NETFRAMEWORK
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
#endif
@@ -68,7 +69,15 @@ namespace EnvelopeGenerator.PdfEditor
{
var page = doc.GetPage(pageIndex);
design(doc.GetPage(pageIndex));
});
});
public Pdf<TInputStream, TOutputStream> Page(Action<PdfPage> design)
{
for (int i = 1; i <= _doc.GetNumberOfPages(); i++)
Page(i, design);
return this;
}
public Pdf<TInputStream, TOutputStream> Design(int pageIndex, Action<PdfCanvas> design)
=> Document(doc =>
@@ -82,6 +91,13 @@ namespace EnvelopeGenerator.PdfEditor
public Pdf<TInputStream, TOutputStream> Background<TSignature>(IEnumerable<TSignature> signatures)
where TSignature : ISignature
{
// once per page
Page(page =>
{
var canvas = new PdfCanvas(page);
canvas.ConcatMatrix(1, 0, 0, -1, 0, page.GetPageSize().GetHeight());
});
foreach (var signature in signatures)
Page(signature.Page, page =>
{
@@ -95,10 +111,6 @@ namespace EnvelopeGenerator.PdfEditor
double bottomLineLength = 2.5;
Rectangle pageSize = page.GetPageSize();
canvas.ConcatMatrix(1, 0, 0, -1, 0, pageSize.GetHeight());
// draw background
canvas.SetFillColor(new DeviceRgb(222, 220, 215))
.Rectangle(x, y, width, height)

View File

@@ -12,9 +12,9 @@
<PackageTags>digital data envelope generator web</PackageTags>
<Description>EnvelopeGenerator.Web is an ASP.NET MVC application developed to manage signing processes. It uses Entity Framework Core (EF Core) for database operations. The user interface for signing processes is developed with Razor View Engine (.cshtml files) and JavaScript under wwwroot, integrated with PSPDFKit. This integration allows users to view and sign documents seamlessly.</Description>
<ApplicationIcon>Assets\icon.ico</ApplicationIcon>
<Version>3.4.0</Version>
<AssemblyVersion>3.4.0</AssemblyVersion>
<FileVersion>3.4.0</FileVersion>
<Version>3.4.1</Version>
<AssemblyVersion>3.4.1</AssemblyVersion>
<FileVersion>3.4.1</FileVersion>
<Copyright>Copyright © 2025 Digital Data GmbH. All rights reserved.</Copyright>
</PropertyGroup>

View File

@@ -37,6 +37,7 @@ try
Directory
.GetFiles(builder.Environment.ContentRootPath, "appsettings.*.json", SearchOption.TopDirectoryOnly)
.Where(file => Path.GetFileName(file) != $"appsettings.Development.json")
.Where(file => Path.GetFileName(file) != $"appsettings.migration.json")
.ToList()
.ForEach(file => config.AddJsonFile(file, true, true));

View File

@@ -96,6 +96,8 @@
</details>
</section>
</div>
@if (smsExpiration is not null)
{
<script nonce="@nonce">
var expiration = new Date(@Html.Raw(JsonConvert.SerializeObject(smsExpiration)));
@@ -121,4 +123,5 @@
var remainingTime = `${formattedMinutes}:${formattedSeconds}`;
element.textContent = remainingTime;
}, 1000);
</script>
</script>
}