Added the `System.ComponentModel.DataAnnotations.Schema` namespace.
Introduced new properties to the `SignatureDto` class:
- `FullName` (string?) for the full name of the signature entity.
- `Position` (string?) for the position of the signature entity.
- `Place` (string?) for the place associated with the signature entity.
- `Ink` (byte[]?) for the ink data of the signature entity.
Replaced non-English comments with English equivalents across
`EnvelopeViewer.razor` and `pdf-viewer.js` to improve code
readability and maintainability. Updated comments to clarify
the purpose of variables, methods, and DOM manipulation logic
without altering functionality. These changes ensure the
codebase is more accessible to a broader audience.
Refactored `DocSignedNotification` to remove inheritance from
`EnvelopeReceiverDto` and introduced a required `EnvelopeReceiver`
property. Updated all usages across the codebase to align with the
new structure, including controllers, handlers, and tests.
- Improved encapsulation and reduced coupling by making
dependencies explicit.
- Updated `AnnotationController`, `DocStatusHandler`,
`HistoryHandler`, and `SendSignedMailHandler` to use the
`EnvelopeReceiver` property.
- Adjusted `DocSignedNotificationTests` to reflect the new
instantiation pattern.
- Updated XML documentation and ensured consistent access to
`EnvelopeReceiver` properties like `EnvelopeId`, `ReceiverId`,
and `EmailAddress`.
Refactored `AnnotationController` to simplify `DocSignedNotification` creation and improve error handling. Replaced the `ToDocSignedNotification` extension method with direct instantiation of `DocSignedNotification`. Introduced a `try-catch` block to handle exceptions during notification publishing, ensuring a `RemoveSignatureNotification` is sent on failure.
Removed `ToDocSignedNotification` and `PublishSafely` extension methods, as their functionality was inlined into the controller. Updated tests to reflect these changes. Simplified the `DocSignedNotification` class by removing redundant methods.
Improved maintainability and clarity by reducing dependencies on extension methods and handling exceptions explicitly.
Simplified the configuration of the distributed SQL Server cache by using the `Bind` method to map all properties from the `Cache:SqlServer` configuration section directly to the `options` object.
Added a fallback to ensure the `ConnectionString` is set to `connStr` if it is empty or whitespace.
Configured the application to use SQL Server as a distributed
cache provider. Added `AddDistributedSqlServerCache` to
`Program.cs` and set up the connection string, schema name,
and table name from the `Cache:SqlServer` configuration
section. This enables persistent and shared caching across
multiple application instances.
Added a new package reference for `Microsoft.Extensions.Caching.SqlServer` version `8.0.11`, conditionally included for the `net8.0` target framework. This enables SQL Server-based caching functionality for applications targeting .NET 8.0.
Added a "SqlServer" object under the "Cache" section in
`appsettings.json` with properties for "ConnectionString",
"SchemaName" (set to "dbo"), and "TableName" (set to "TBDD_CACHE").
No changes were made to the "SignatureCacheExpiration" property,
but it was re-added in the diff for context.
Updated `ReceiverSignature` usage in `CacheController` to reflect its refactoring from a property to a method. This change was applied consistently across the `SaveSignature`, `GetSignature`, and `DeleteSignature` methods, ensuring the `cacheKey` variable now uses `User.ReceiverSignature()` instead of `User.ReceiverSignature`. This refactor likely accommodates additional logic in the `ReceiverSignature` method.
Added a new button in `EnvelopeViewer.razor` for creating or modifying signatures, with dynamic styling and tooltips based on the signature state. Enhanced `OpenSignaturePopup` and `OnPopupShownAsync` methods to preload and display existing signatures in the popup and canvas.
Introduced new "success" button styles in `envelope-viewer.css` for better visual feedback. Added `loadExistingSignature` function in `receiver-signature.js` to render existing signatures on the canvas and updated the public API to expose this functionality.
Introduced `SignatureCacheService` and `ILogger<EnvelopeViewer>` to enable caching and logging functionality. Added logic to load cached signatures when available, bypassing the signature popup. Implemented asynchronous, fire-and-forget caching of captured signatures, with error handling to ignore cache failures. Updated signature handling to integrate with the caching mechanism, improving user experience and performance.
Replaced scoped services from the `EnvelopeGenerator.ReceiverUI.Services` namespace with their counterparts without the namespace prefix. Added a new `SignatureCacheService` and updated `AppVersionService` to use the non-namespaced version.
Added `builder.RootComponents.Add<HeadOutlet>("head::after");` to register a root component. Introduced configuration binding for `ApiOptions` and `PdfViewerOptions`.
DevExpress components for reporting and PDF viewing remain unchanged, with additional configuration for `DevExpressBlazorReportingWebAssembly` included.
- Added `using EnvelopeGenerator.API.Extensions;` for utilities.
- Changed `SignatureCacheKeyPrefix` to a new prefix value.
- Added `[Authorize(Policy = AuthPolicy.Receiver)]` to methods.
- Used `[FromRoute]` for `envelopeKey` in route-bound methods.
- Updated cache key logic to use `User.ReceiverSignature`.
- Made `DataUrl`, `FullName`, and `Place` required in `SignatureCacheRequest`.
- Set default value (`null`) for `Position` in `SignatureCacheRequest`.
Refactored multiple controllers (`AnnotationController`,
`DocumentController`, `ReadOnlyController`, and
`SignatureController`) to use updated claim extension methods
(`ReceiverSignature`, `EnvelopeUuid`, etc.), replacing older,
verbose methods for improved readability and consistency.
Removed the `EnvelopeClaimTypes` class and replaced claim type
constants with `EnvelopeClaimNames`. Simplified claim retrieval
logic in `ReceiverClaimExtensions` by consolidating methods and
removing redundant or unused functionality.
Eliminated the `SignInEnvelopeAsync` method, indicating a shift
away from manual claim management. Performed general cleanup,
including removing obsolete code and improving exception
messages for better debugging context.
Introduced a new `SignatureCacheService` class to handle
cached signatures via API interactions. This includes methods
for saving, retrieving, and deleting signatures using `HttpClient`.
- Added dependency injection for `HttpClient` and `IOptions<ApiOptions>`.
- Implemented `SaveSignatureAsync`, `GetSignatureAsync`, and
`DeleteSignatureAsync` methods with error handling.
- Utilized `Uri.EscapeDataString` for safe URL encoding.
- Added support for HTTP operations with `System.Net.Http.Json`.
Introduced a new `CacheController` to manage cached data for
receiver signatures using distributed caching. Added endpoints
to save, retrieve, and delete cached signatures.
Created a `SignatureCacheRequest` model for caching payloads
and a `CacheOptions` class to configure cache settings,
including optional expiration. Updated `Program.cs` to bind
`CacheOptions` to the `Cache` section in `appsettings.json`.
Added a new `Cache` section in `appsettings.json` with a
`SignatureCacheExpiration` property, defaulting to `null`
(no expiration).
Added four new properties (`FullName`, `Position`, `Place`, and
`Ink`) to the `Signature` class. Each property is annotated with
the `[Column]` attribute to map to corresponding database columns
(`FULL_NAME`, `POSITION`, `PLACE`, and `INK`). The properties
support nullable values based on the `nullable` directive,
ensuring compatibility with nullable reference types. These
changes enhance the `Signature` class by enabling additional
data storage and retrieval.
Introduced a new `SignatureCaptureDto` model to encapsulate
signature-related data and metadata, replacing the previous
`SignatureCapture` type in `EnvelopeViewer.razor`.
- Added `SignatureCaptureDto` in `SignatureCaptureDto.cs` with
properties for signature image, signer name, position, and place.
- Updated `_capturedSignature` to use `SignatureCaptureDto` for
consistency and maintainability.
- Refactored signature capture logic to initialize
`SignatureCaptureDto` using object initializer syntax.
- Improved code clarity with detailed XML documentation for
`SignatureCaptureDto`.
These changes enhance maintainability, readability, and ensure
a centralized model for signature-related data.
Refactored `_capturedSignature` to `SignatureCaptureDto`, a
sealed record with required and optional properties for better
type safety and clarity. Updated components to use the new
model and demonstrated initialization with object initializers.
Enhanced `EnvelopeViewer` with modern UI features, including
HiDPI/Retina support, configurable zoom options, smooth zoom
transitions, and improved thumbnail sidebar functionality.
Updated `Applied Signature` HTML overlay to support dynamic
positioning for rendering signatures at specific coordinates.
Revised documentation in `COPILOT_CONTEXT_EN.md` to reflect
changes in the signature data structure and usage. Noted that
current implementation provides visual overlays only, with
future consideration for actual PDF stamping using PSPDFKit.
Updated the NuGet package version from 1.4.0 to 1.4.1 to reflect a minor update or patch release.
Aligned `<AssemblyVersion>` and `<FileVersion>` to 1.4.1.0 for consistency with the new version.
Added a reset button to the PDF toolbar in `EnvelopeViewer.razor`
to allow users to reset all signatures and state. The button is
conditionally displayed when there are signed signatures
(`_signedSignatures > 0`).
Implemented the `RestartSigning` method to reload the page and
reset all signatures by navigating to the current URI with
`forceLoad: true`.
Introduced new styles in `envelope-viewer.css` for the reset
button, including hover effects, background gradients, border
colors, and transitions for a polished user experience.
Updated the reset button to include an SVG icon with hover
effects for better visual feedback and consistency with the
application's design.
Updated version numbers in `EnvelopeGenerator.API.csproj`
from 1.3.1 to 1.4.0, including `<Version>`, `<FileVersion>`,
and `<AssemblyVersion>`.
Updated version numbers in `EnvelopeGenerator.ReceiverUI.csproj`
from 1.3.0 to 1.4.0, including `<Version>`, `<AssemblyVersion>`,
and `<FileVersion>`.
Adjusted copyright year in `EnvelopeGenerator.ReceiverUI.csproj`
from 2026 to 2025 to align with the release timeline.
Updated `EnvelopeViewer.razor` to use versioned URLs for CSS and JS files via the new `AppVersionService`, enabling cache busting.
Introduced `AppVersionService` to generate versioned URLs based on the application version retrieved from assembly metadata.
Registered `AppVersionService` as a singleton in `Program.cs` for dependency injection.
Introduce a new route `/report-viewer/{EnvelopeKey}` alongside the existing `/receiver/{EnvelopeKey}`. Add redirection logic in `OnInitializedAsync` to navigate to `/envelope/{key}` for the new PDF.js viewer if `EnvelopeKey` is provided. Ensure this redirection takes precedence over the envelope access check.
Reduced delay in `OnZoomChanged` to improve responsiveness when rendering signature buttons. Added calls to `RenderSignatureButtonsAsync` in zoom-related methods to ensure signature overlays update dynamically.
Refactored `pdf-viewer.js` to introduce `appliedSignatureElements` for better management of applied signatures. Added `scaleAppliedSignature` and `updateAppliedSignaturePositions` methods to dynamically scale and position applied signatures based on zoom level and page.
Enhanced signature button rendering by scaling dimensions (width, height, font size, icon size) proportionally with zoom. Added attributes to store base values for applied signature containers to facilitate scaling.
Improved handling of applied signatures to ensure proper scaling, positioning, and visibility during zoom and page navigation. These changes enhance user experience and maintain consistency across zoom levels.
Removed `max-width` constraints from `body.resizing` to allow more flexible layouts. Updated `width` properties in `body.resizing` and `.pdf-frame` to slightly increase their sizes, improving space utilization. These changes refine the design to better align with the intended user interface behavior.
The `<PackageReference Include="itext" Version="8.0.5" />` was removed from `EnvelopeGenerator.ReceiverUI.csproj`. This change indicates that the project no longer relies on the `itext` library, which is typically used for PDF generation and manipulation.
Updated `COPILOT_CONTEXT_TR.md` to provide detailed documentation for the `EnvelopeGenerator` project, including its purpose, structure, key components, and workflows. Added a comprehensive explanation of the `AnnotationDto` coordinate system and documented the resolution of a critical signature positioning bug.
Documented an open task in `OPEN_TASK.md` for implementing cross-page signature navigation in `EnvelopeViewer.razor`. Highlighted issues with the counter and navigation logic, provided a detailed specification for expected behavior, and proposed a step-by-step implementation strategy with JavaScript code snippets. Marked the task as "Failed" due to prior regressions, with instructions to revert and fix.
The `<div class="envelope-action-bar__inner">` layout was updated to use a column-based structure for better alignment and spacing. Title and sender details now include additional information such as the sender's full name, email, and the envelope's added date.
Badges for receiver name, signature count, access code, and 2FA were visually refined with smaller padding, font sizes, and resized SVG icons. A new section was added to display public and private messages with distinct styles and icons.
The logout button's placement was adjusted to fit the new layout. Minor spacing, padding, and alignment adjustments were made throughout the component for a cleaner and more consistent design.
Updated the `EnvelopeViewer` component to improve the user interface and functionality:
- Added `EnvelopeReceiverService` injection to fetch receiver data.
- Redesigned `envelope-action-bar` for better alignment and responsiveness.
- Displayed dynamic document title and compact badges for receiver info, sender name, signature count, and security features (e.g., access code, 2FA).
- Refactored logout button styling and `envelope-content` layout.
- Introduced `_envelopeReceiver` field and updated `SignatureService.GetAsync` to fetch receiver data.
- Added debugging logs for loaded signatures.
- Added fields for managing signature navigation state.
Updated the navigation path in `Login.razor` to redirect to `/envelope/{EnvelopeKey}` instead of `/receiver/{EnvelopeKey}`. This change aligns with the updated routing structure and ensures proper redirection after a successful login.
Updated `MaxThumbnailWidth` to 400 in `EnvelopeViewer.razor`.
Added an authentication check using `AuthService.CheckEnvelopeAccessAsync`
to ensure users have access to the envelope. Redirects unauthorized
users to a login page with the `EnvelopeKey` in the URL. The check
is performed before fetching the document via `DocumentService`.
The `OPEN_TASK.md` file was removed from the `SolutionItems`
section of the `src` project in the `EnvelopeGenerator.sln`
solution file. This change ensures the file is no longer
tracked as part of the solution.
Added dependency injection for `AuthService` to enable authentication-related operations. Introduced a logout button in the UI, conditionally displayed when `EnvelopeKey` is valid, with a spinner and SVG icon for better UX.
Implemented the `LogoutAsync` method to handle the logout process, ensuring no concurrent logouts and redirecting the user to the login page. Added `_isLoggingOut` to manage logout state. Updated `OnInitializedAsync` for better error handling when `EnvelopeKey` is missing.
Added functionality to display the current signature index in the
signature counter UI in `EnvelopeViewer.razor`, including a new
state variable `_currentSignatureIndex` to track the currently
viewed signature. Updated the logic to fetch and set this value
from the `SignatureNavState` object provided by the JavaScript
runtime.
Modified `pdf-viewer.js` to calculate the current signature index
based on the last viewed signature ID (`_lastViewedSignatureId`)
and return it as part of the `SignatureNavState`. This replaces
the previously hardcoded `signed` value.
These changes improve the user experience by providing a clear
indication of the currently viewed signature in the navigation UI.
Updated `getSignatureNavState`, `goToNextSignature`, and
`goToPreviousSignature` methods to enhance code readability
by improving comments and clarifying logic. Fixed a minor bug
in `goToPreviousSignature` where the wrong variable (`lastSig`)
was used for page navigation, replacing it with the correct
variable (`prevSignature`). Ensured `_lastViewedSignatureId`
is updated correctly in navigation methods. No significant
functional changes were introduced.
Updated the `disabled` attribute logic in `EnvelopeViewer.razor`
to ensure navigation buttons are always active when signatures
exist. Modified `pdf-viewer.js` to enable infinite looping for
signature navigation, allowing users to cycle between the first
and last signatures seamlessly. Adjusted `canGoPrev` and
`canGoNext` properties to depend on the total number of
signatures, ensuring navigation is always enabled when
signatures are present.
Enhanced signature navigation logic to track the last viewed signature (`_lastViewedSignatureId`) and enable cross-page navigation. Updated next/previous navigation to handle both signed and unsigned signatures, with automatic page changes and scrolling to the relevant element.
Added a signature counter to the toolbar, displaying total, signed, and unsigned counts. Improved `renderSignatureButtons()` to filter out applied signatures and updated `clearSignatureButtons()` to manage visibility based on the current page.
Integrated Blazor callbacks (`OnPageChangedBySignatureNav()` and `OnSignatureNavChanged`) for UI updates. Fixed visibility issues where applied signatures appeared on incorrect pages.
Enhanced signature navigation and rendering logic in `pdf-viewer.js`:
- Added `_renderLock` to prevent concurrent page renders.
- Refactored `renderPage` and `queueRenderPage` for stability.
- Updated `goToNextSignature` to support cross-page navigation.
- Filtered out applied signatures during rendering and navigation.
- Improved handling of applied signatures visibility per page.
Updated `EnvelopeViewer.razor`:
- Added `OnPageChangedBySignatureNav` to handle page changes triggered by signature navigation.
Improved code readability, added comments, and removed outdated logic to ensure smooth transitions and better user experience.
Updated `getSignatureNavState` to handle cases where the global signature list (`_allSignatures`) is unavailable or empty by introducing an early return with a default state.
Revised the logic to calculate `total`, `signed`, and `unsigned` using the global signature list, simplifying the `currentIndex` calculation to use the `signed` count. Updated `canGoPrev` and `canGoNext` to reflect the presence of signed or unsigned signatures.
Removed outdated logic relying on `signatureButtons` and added Turkish comments to clarify the new implementation.
Updated `COPILOT_CONTEXT_EN.md` to reflect the correct
coordinate system unit (INCHES) and added conversion
formulas for various systems. Corrected XML documentation
in `SignatureDto.cs`, `AnnotationDto.cs`, and
`AnnotationCreateDto.cs` to specify INCHES as the unit
and removed outdated references to DevExpress units.
Added `OPEN_TASK.md` to the solution file to track it
under `SolutionItems`. Removed incomplete task details
from `OPEN_TASK_SESSION_12.md`.
Provided additional context for future updates, including
database schema details and unit conversion references.
Documented completed changes for Session 12, such as
adding `SignatureService` to DI and fixing YARP routes.
The commit implements cross-page navigation for signatures in the `EnvelopeViewer.razor` component. Users can now navigate between signatures across pages using "Next Signature" and "Previous Signature" buttons.
Key changes:
- Fixed `getSignatureNavState()` to correctly calculate total, signed, and unsigned signatures globally.
- Updated `goToNextSignature()` to navigate to the next unsigned signature, including automatic page changes and scrolling.
- Updated `goToPreviousSignature()` to navigate to the last signed signature, including automatic page changes and scrolling.
- Ensured navigation buttons are properly disabled when no further navigation is possible.
The toolbar design remains unchanged, as requested. These changes address issues caused by a previous implementation that broke the counter and navigation functionality.
This commit introduces a signature navigation feature in the PDF viewer:
- Removed zoom preset buttons to make space for the new toolbar.
- Added "Previous" and "Next" buttons for navigating signatures.
- Displayed a signature counter with signed/total signatures and a badge for unsigned signatures or completion status.
- Introduced state variables (`_totalSignatures`, `_signedSignatures`, `_unsignedSignatures`) to track signature progress.
- Implemented methods for navigating signatures (`GoToPreviousSignature`, `GoToNextSignature`, `UpdateSignatureCounterAsync`).
- Enhanced JavaScript with `getSignatureNavState`, `goToNextSignature`, and `goToPreviousSignature` for navigation logic.
- Updated CSS for the toolbar and signature navigation, including responsive adjustments and hover effects.
- Improved error handling during signature counter updates.
- Updated `RenderSignatureButtonsAsync` to refresh the signature counter after rendering.
These changes improve the user experience by enabling efficient navigation and tracking of signatures in the PDF viewer.
Implemented a complete client-side workflow for creating, applying, and displaying visual signature overlays on the PDF canvas.
- Added "Unterschreiben" buttons with modern styling (purple gradient, hover effects) to apply signatures.
- Introduced a signature creation popup (DxPopup) with Draw, Text, and Image tabs, including validation for required fields (Name, Place).
- Rendered German-style signature overlays with image, separator line, and text (Name, Position, Place, Date in dd.MM.yyyy format).
- Ensured automatic re-rendering of overlays on page load, zoom, and page changes.
- Added `escapeHtml()` for XSS protection of user-provided text.
- Styled popup, canvas, and buttons with a modern, clean design.
- Suggested future enhancements for server-side stamping or integration with commercial PDF libraries.
Refactored `OnSignatureButtonClick` in `EnvelopeViewer.razor`:
- Converted to async and added null-check for `_capturedSignature`.
- Integrated `pdfViewer.applySignature` to apply signatures to PDFs.
Added `applySignature` method to `pdf-viewer.js`:
- Handles rendering of signatures with image, metadata, and styling.
- Follows German standards for signature formatting.
- Includes error handling for missing elements.
Introduced `escapeHtml` helper in `pdf-viewer.js` to prevent XSS.
Updated `MaxThumbnailWidth` in `EnvelopeViewer.razor` to 400.
Enhanced logging for better debugging during signature application.
Introduced a `DxPopup` for signature creation in `EnvelopeViewer.razor`, supporting three input methods: drawing, text, and image upload.
- Added `receiver-signature.js` for signature handling via JavaScript interop.
- Implemented tab-based UI for switching between signature methods.
- Added validation for required fields (e.g., full name, place).
- Enhanced text signature customization with font selection and dynamic rendering.
- Introduced state management for signature input and popup visibility.
- Added methods for initializing, clearing, and saving signatures.
- Styled the popup for a user-friendly experience and added error messages.
- Configured the popup to open automatically on page load or button click.
This feature improves the user experience by providing a flexible and intuitive way to create signatures.
The file `OPEN_TASK_SESSION_12.md` was removed from the
`SolutionItems` section of the `src` project in the
`EnvelopeGenerator.sln` solution file. This change ensures
that the file is no longer tracked as part of the solution.
Documented the new client-side signature overlay system for
EnvelopeViewer, replacing iText7 due to GPL license issues.
Outlined the signature data structure in C# and JavaScript,
and described the workflow steps for creating, applying,
and displaying signatures as visual overlays.
Added a "Future Enhancement Required" section suggesting
commercial PDF libraries or server-side stamping for future
improvements.
The text content of a `div` element in `pdf-viewer.js` was updated from "Sign" to "Unterschreiben" to support German localization. This change improves the user interface for German-speaking users by providing a translated label.
Implemented a new feature to render clickable "Sign" buttons on the PDF canvas at signature field positions fetched from the database.
- Updated `EnvelopeViewer.razor` to fetch signature data, convert coordinates from inches to points, and invoke JavaScript for rendering.
- Added `renderSignatureButtons` and `clearSignatureButtons` functions in `pdf-viewer.js` to dynamically create and position buttons based on page and zoom level.
- Modified HTML to include a new `#pdf-signature-layer` overlay for buttons.
- Styled buttons with a purple gradient, hover/active effects, and focus outlines for accessibility.
- Defined rendering triggers for initial load, page changes, and zoom changes.
- Documented coordinate conversion flow from inches to points to pixels for accurate positioning.
- Enhanced accessibility with `tabindex="0"`, focus outlines, and semantic `<button>` elements.