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.
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.
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 `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.
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.
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`.
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.
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.
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 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.
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 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.
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.
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.
Updated `envelope-viewer.css` to enhance the layout and responsiveness of the PDF toolbar:
- Adjusted padding, gap, width, and alignment for better usability.
- Improved zoom section and slider styles for flexibility and consistency.
Enhanced `pdf-viewer.js` to handle concurrent rendering tasks:
- Added checks to prevent overlapping render tasks on the same canvas.
- Implemented error handling for rendering operations to ensure stability.
These changes improve the user experience and robustness of the PDF viewer.
Removed the `_comment` field from the `PdfViewer` section, which described the PDF Viewer Quality Settings.
Increased `ZoomTransitionDuration` from 150 to 900 to adjust zoom transition behavior, potentially improving user experience.
Added a `ZoomStepPercentage` property to `PdfViewerOptions` to allow configurable zoom step increments (1-50, default 5%). Updated `EnvelopeViewer.razor` to use this property for the zoom slider step. Modified `pdf-viewer.js` to apply the zoom step percentage for mouse wheel zoom, `zoomIn`, and `zoomOut` methods.
Included `ZoomStepPercentage` in `appsettings.json` and `setQualityOptions` for dynamic updates. Reduced `ZoomTransitionDuration` in `appsettings.json` from 900ms to 150ms for faster zoom transitions. These changes ensure consistent and customizable zoom behavior across the application.
Introduced `PdfViewerOptions` class to centralize PDF viewer
settings such as scaling, HiDPI support, zoom transitions,
and rendering delays. Bound these options to `appsettings.json`
for dynamic configuration.
Injected `PdfViewerOptions` into `EnvelopeViewer.razor` and
updated `OnInitializedAsync` to pass settings to JavaScript.
Replaced hardcoded values in `pdf-viewer.js` with configurable
options, improving maintainability and flexibility.
Enhanced rendering logic to respect HiDPI settings, maximum
DPR, and smooth zoom transitions. Improved thumbnail rendering
with configurable delays to optimize performance.
Added `image-rendering` properties and opacity transitions to `.pdf-canvas` for smoother visual effects during rendering. Introduced a `.pdf-canvas.rendering` class to indicate rendering state.
Enhanced `renderPage` method to support HiDPI displays by scaling the viewport based on device pixel ratio (up to 2) and setting both internal resolution and CSS display size for better rendering quality. Enabled high-quality rendering with `imageSmoothingEnabled` and `imageSmoothingQuality`.
Updated scroll container reference to `.pdf-canvas-wrapper` for proper alignment. Added logic to manage the `rendering` class during and after rendering, including error handling to ensure UI consistency. These changes improve both functionality and aesthetics of the PDF viewer.
Enhanced thumbnail rendering in `envelope-viewer.css` by adding `image-rendering` properties for better visual quality.
Updated `pdf-viewer.js` to support high-quality rendering with HiDPI support:
- Replaced fixed scale with dynamic scaling using `devicePixelRatio` (capped at 2x) and a base scale of 0.75.
- Adjusted canvas resolution to match scaled viewport dimensions.
- Removed inline canvas styles to delegate display size to CSS.
- Retained high-quality rendering settings for the canvas context.
These changes improve visual fidelity while maintaining performance.
Increased the scale for rendering PDF pages from 0.2 to 0.5 in the
`getViewport` method to enhance resolution and sharpness. Although
CSS scales the canvas down, the higher scale ensures better visual
quality.
Enabled high-quality rendering for the canvas context by setting
`ctx.imageSmoothingEnabled` to `true` and `ctx.imageSmoothingQuality`
to `'high'`, resulting in smoother and sharper PDF content rendering.
Updated the `.pdf-thumbnail__canvas` CSS class to replace
`max-width`, `max-height`, and `display: block` with `width`,
`height`, `object-fit: contain`, and `object-position: center`.
These changes ensure the canvas fully occupies its container,
scales proportionally without cropping, and centers the content
for better visual consistency and usability.
Refactor the `ToggleThumbnails` method to be asynchronous (`async Task`) to support asynchronous operations. Add logic to re-render thumbnails when toggled on, including forcing a UI update, waiting for DOM rendering, and invoking `RenderThumbnailsAsync`. These changes improve the user experience by ensuring thumbnails are properly updated when displayed.
Introduced a resizable splitter for the PDF thumbnail sidebar, allowing users to dynamically adjust its width. Added `_thumbnailWidth` property with min/max constraints and implemented mouse event handlers (`OnSplitterMouseDown`, `OnSplitterMouseMove`, `OnSplitterMouseUp`) to manage resizing.
Integrated JavaScript interop to attach/detach resize event listeners and save user preferences to `localStorage`. Updated `pdf-viewer.js` to handle resizing state and cleanup. Styled the splitter in `envelope-viewer.css` with hover/active states and ensured smooth interaction.
Persisted thumbnail width across sessions and added error handling for `localStorage`. Enhanced user experience with intuitive resizing and improved UI flexibility.
Removed the header section of the PDF thumbnail sidebar, including the title and close button, to streamline the UI. Updated Razor logic to control sidebar visibility directly, eliminating the need for `.pdf-thumbnails--visible`. Deleted associated CSS styles for the removed elements. Retained scrolling and padding styles for the thumbnail content.
Refactor the PDF thumbnail sidebar to use Razor logic for dynamic visibility control, removing reliance on CSS-based toggling. Updated the `pdf-thumbnails` layout to use `relative` positioning and improved its integration with the viewer structure. Introduced a new `pdf-canvas-wrapper` for better styling, scrolling, and alignment of the main PDF canvas.
Enhanced responsiveness by adjusting `pdf-thumbnails`, `pdf-thumbnails__content`, and `pdf-toolbar` styles for smaller screens. Deprecated the `pdf-thumbnails--visible` class and removed redundant CSS properties to simplify the codebase. Updated the `pdf-frame` layout to use a column-based flexbox for better alignment.
These changes improve maintainability, responsiveness, and the overall user experience of the `EnvelopeViewer` component.