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.
Introduced functionality to render interactive signature buttons on the PDF viewer. Added support for fetching and displaying signature data (`SignatureDto`) dynamically based on the current page.
- Added `@using` directives in `EnvelopeViewer.razor` for required namespaces.
- Introduced `_signatures` field to store signature data.
- Updated `OnInitializedAsync` to fetch and process signatures.
- Implemented `RenderSignatureButtonsAsync` to dynamically render buttons.
- Added `[JSInvokable]` method `OnSignatureButtonClick` for button events.
- Updated CSS to style `pdf-signature-layer` and `signature-button`.
- Enhanced `pdf-viewer.js` with methods to render and clear buttons.
- Ensured buttons respond to zoom and page navigation changes.
- Added error handling and logging for signature rendering.
These changes improve user interaction by enabling signing functionality directly on the PDF viewer.
Introduce a new static class `SignatureDtoExtensions` that adds
a `Convert<T>` extension method for collections of `SignatureDto`
objects. This method converts all `SignatureDto` instances in a
collection to a specified `UnitOfLength`, modifying them in place
and returning the same collection.
The method includes:
- A generic constraint to support any `IEnumerable<SignatureDto>`.
- Null checks to ensure the collection is not null.
- Comprehensive XML documentation with usage examples and notes.
Introduced the `UnitOfLength` enum to represent measurement units
(Inch and Point) for signature positioning, with detailed
documentation and conversion logic.
Updated `SignatureDto` to use `init` accessors for immutability,
added backing fields for `X` and `Y` with conversion support, and
introduced the `Factor` property to handle unit conversions.
Added a `Convert` method to enable switching between units of
length and improved extensibility for future `SenderAppType`
support. Enhanced code readability and maintainability with
detailed comments and remarks.
A new `SenderAppType` enum was introduced in the
`EnvelopeGenerator.ReceiverUI.Models.Constants` namespace, with
values `LegacyFormApp` and `ReceiverUIBlazorApp`.
The `SignatureDto` class was updated to include a new property of
type `SenderAppType`, enabling the specification of the sender
application type for a signature.
Additionally, a `using` directive for the
`EnvelopeGenerator.ReceiverUI.Models.Constants` namespace was added
to `SignatureDto.cs` to support the use of the new enum.
Updated the `using` directives in `SignatureDto.cs` to include the `EnvelopeGenerator.Domain.Constants` namespace and reordered the existing namespaces. Added a new `SenderAppType` property to the `SignatureDto` class, with a default value of `SenderAppType.LegacyFormApp`.
A new namespace `EnvelopeGenerator.Domain.Constants` was added,
containing the `SenderAppType` enumeration. This enum defines
two members: `LegacyFormApp` (0) and `ReceiverUIBlazorApp` (1).
The addition improves type safety and maintainability by
providing a structured way to differentiate between sender
application types.
Updated the digital document signing system to use INCHES as the standard unit for annotations and signatures, aligning with GdPicture14's native format. Previously used DevExpress units (1/100 inch) and other formats have been replaced.
- Updated `AnnotationDto` to reflect the new coordinate system.
- Introduced `SignatureDto` for signature positions, deprecating `AnnotationDto`.
- Added conversion formulas for transforming coordinates between INCHES and other systems (DevExpress, PDF Points, PDF.js, etc.).
- Added a unit comparison table and A4 page dimensions in various units.
- Introduced a new read-only PDF.js viewer for envelopes (`/envelope/{EnvelopeKey}`).
These changes improve consistency, simplify conversions, and align with modern tools like PSPDFKit and iText7.
Added a new solution item `OPEN_TASK_SESSION_12.md` to the
`src` project section in the `EnvelopeGenerator.sln` file.
This was included under the `SolutionItems` subsection of
the `src` project.
Updated documentation and code comments to reflect INCHES as the
coordinate unit instead of 1/100 inch. Replaced special characters
causing issues with proper symbols (e.g., `—`, `≈`, `→`).
- Updated VB.NET code snippet to clarify INCHES usage.
- Revised `COPILOT_CONTEXT_EN.md` with updated formulas, unit
comparison tables, and database storage format details.
- Corrected XML documentation for `SignatureDto` and `AnnotationDto`
in C# to reflect INCHES as the unit.
- Clarified database schema documentation for coordinate fields.
- Improved unit conversion quick reference with accurate formulas.
- Added A4 page dimensions reference in multiple units.
- Marked completed tasks in "Session 12 Changes Already Completed"
with detailed descriptions.
Updated documentation and code comments to reflect that the
coordinate system uses INCHES (not 1/100 inch or DX units).
- Updated `COPILOT_CONTEXT_EN.md`:
- Clarified database stores coordinates in INCHES.
- Added conversion formulas and unit comparison table.
- Renamed section to `SignatureDto / AnnotationDto`.
- Updated XML documentation in C# files:
- `SignatureDto.cs`: Added XML comments for INCHES-based coordinates.
- `AnnotationDto.cs`: Corrected unit description and added conversions.
- `AnnotationCreateDto.cs`: Fixed `X` and `Y` property comments.
- Verified VB.NET source (`frmFieldEditor.vb`) as the unit reference.
- Added quick reference for unit conversions across systems.
Expanded `yarp.json` with new routes for the `receiver-ui` cluster to handle paths for `appsettings.json`, `appsettings.Development.json`, styles, fonts, and images. These routes specify HTTP methods and execution order.
Registered `SignatureService` as a scoped dependency in `Program.cs` to support new functionality related to handling signatures.
Replaced AnnotationDto and AnnotationService with SignatureDto
and SignatureService for handling signature data. Marked
AnnotationDto and AnnotationService as obsolete.
Added the SignatureDto class to represent signature data and
introduced the SignatureService class to fetch signature data
from the API. Updated EnvelopeViewer.razor to use
SignatureService, replacing AnnotationService, and added a
debug log for retrieved signatures.
Performed general refactoring to align with the new signature
data model and functionality.
The `GetAnnotsOfReceiver` method was removed from the `AnnotationController` class and moved to a newly introduced `SignatureController` class. The `SignatureController` is now a dedicated controller for handling signature-related endpoints, decorated with `[ApiController]` and `[Route("api/[controller]")]`.
The method's implementation remains largely unchanged, retaining its logic for retrieving and filtering signatures for a specific receiver. Dependency injection for `IMediator` was added to the `SignatureController` to handle the `ReadDocumentQuery`.
Additional `using` directives were added to `SignatureController.cs` to include necessary namespaces. A `TODO` comment remains in the method, indicating potential future updates.
A new property `Annotations` of type `IEnumerable<AnnotationDto>?`
was added to the `SignatureDto` class. This property includes a
getter and setter, allowing the class to manage a collection of
annotations. The property is nullable, enabling it to hold a
`null` value if no annotations are present.
Refactored the `Handle` method in `ReadDocumentQueryHandler` to
eagerly load related data (`Elements` and `Annotations`) using
`Include` and `ThenInclude`. Introduced a reusable `docQuery`
variable to reduce code duplication and ensure consistency in
queries for both `query.Id` and `query.EnvelopeId`. No changes
were made to the mapping logic or exception handling.
Introduced the `GetAnnotsOfReceiver` method in `AnnotationController` to handle HTTP GET requests for retrieving receiver-specific annotations. The method enforces authorization using the `Receiver` policy, fetches the document via a mediator query, and filters signatures based on the current receiver. Returns appropriate HTTP responses for empty documents or missing signatures.
Added new `using` directives for required dependencies and reorganized imports for better readability. Included a `TODO` comment for potential future updates.
Updated ReceiverClaimExtensions to include a new array,
`ReceiverIdClaimTypes`, for receiver ID claim types. Added
`GetReceiverIdOfReceiver` method to retrieve and validate
receiver ID claims. Modified the exception message in
`GetEnvelopeIdOfReceiver` to use a string literal for
clarity.
Added new routes to the `ReverseProxy` configuration, including
`receiver-ui-login`, `receiver-ui-sender`, `receiver-ui-envelope`,
and others to handle specific paths, HTTP methods, and transformations.
Removed outdated routes such as `receiver-ui-static-assets` and
`receiver-ui-annotation-fake` to streamline the configuration.
Introduced transformations for response headers (e.g., `Cache-Control`)
and updated `auth-login` and `auth-envelope-receiver-login` routes
with new path patterns and query parameters.
Reorganized `receiver-ui` cluster routes to better handle static
assets (CSS, JS, Blazor framework, and content) and fake data.
Removed unnecessary console output for non-critical features, including `console.log`, `console.warn`, and `console.error` statements in `setQualityOptions`, `renderTextLayer`, and `renderThumbnail` methods. This reduces noise in production logs.
Added a CSS variable `--scale-factor` to the text layer's `style` in `renderTextLayer` to ensure proper scaling and improve text rendering accuracy. These changes enhance code cleanliness and robustness.
Integrated PDF.js to enable text selection and copy-paste functionality in the PDF viewer. Updated `EnvelopeViewer.razor` to include the necessary scripts and styles, and modified the HTML structure to add a text layer container.
Enhanced `envelope-viewer.css` with styles for the text layer and optimized canvas rendering. Added a `renderTextLayer` method in `pdf-viewer.js` to extract and render text content from PDF pages. Updated the rendering process to overlay the text layer on the canvas.