Releases: nowo-tech/PdfSignableBundle
Releases · nowo-tech/PdfSignableBundle
Release v2.0.4
Release v2.0.4
Changelog
Changed
- PHP-CS-Fixer: Refined rules to align with PSR-12 and Symfony coding standards.
- Docker: Root and demo Dockerfiles updated to PHP 8.2 Alpine; added dependencies for development and testing.
- Demos: Symfony 7 and 8 demos now serve over HTTP by default (Caddyfile updated) to simplify local development; Makefiles enhanced with commands for restarting containers, building images, and running tests; added README files with quick start instructions for each demo.
- CI: Simplified GitHub Actions workflow (ci.yml).
Developer
- CHANGELOG, UPGRADING, and RELEASE checklist updated for 2.0.4.
For upgrade steps from 2.0.3, see UPGRADING.
Commits
Release v2.0.3
Release v2.0.3
Changelog
Changed
- Packagist: Removed
repositoryfromcomposer.jsonsocomposer validate --strictpasses when publishing the package. No impact on installs; Packagist uses the repo URL from package registration.
For upgrade steps from 2.0.2, see UPGRADING.
Commits
Release v2.0.2
Release v2.0.2
Changelog
Added
- Routes: Comment in
Resources/config/routes.yamlwith a copy-paste example for the app’sconfig/routes.yaml(resource + prefix), reducing friction on first install. - Proxy URL allowlist validation (dev):
ProxyUrlAllowlistValidationPassruns at container compile whenkernel.debugis true; validates regex patterns (entries starting with#) inproxy_url_allowlistand triggersE_USER_WARNINGif a pattern is invalid. Does not run in production. - Tests: Broader coverage:
ProxyUrlValidator(SSRF: empty host, private ranges 10.x/192.168.x/169.254.x, IPv6 link-local/loopback; allowlist: empty pattern skip, no-match returns false, invalid regex with/without logger).DependencyCheckListenercache (reuses request attribute, does not call checker again).NowoPdfSignableBundle::build()registers the compiler pass.CheckDependenciesCommandoutput with warnings when not strict.SignatureCoordinatesModel::fromArrayskips non-array box items.Configurationacroformlabel_mode,font_sizes,font_familiesdefaults and overrides. NewProxyUrlAllowlistValidationPassTestfor the compiler pass. - Test groups:
DependencyCheckerTest::testCheckWhenBundlePublicDirMissingAddsWarningandtestCheckRequiredExtensionsInFailureMessageWhenMissingmarked with@group integrationso CI can exclude them with--exclude-group integrationif needed.
Changed
- (None.)
Fixed
- ProxyUrlValidator (SSRF): When
parse_url($url, PHP_URL_HOST)returnsfalse(e.g. malformed URL likehttp:///path), the validator no longer passes it tostrtolower(); invalid or missing host is now treated as blocked. IPv6 literal hosts in URLs (e.g.http://[::1]/orhttp://[fe80::1]/) are normalized (brackets stripped) and link-local (fe80:) is blocked via an early string check so SSRF blocking works in all environments.
Documentation
- Documentation: Added “Estado de las mejoras (seguimiento)” table tracking implementation of review suggestions (routes, allowlist validation, integration group).
For upgrade steps from 2.0.1, see UPGRADING.
Commits
- Prepare v2.0.2 release (4739288)
- Refactor code for consistency and readability (82a1ed0)
- Refactor getWorkerUrl to return default bundle worker path (45d54ba)
- Merge branch 'master' of github.com:nowo-tech/PdfSignableBundle (eee1146)
- Refactor test for SignatureCoordinatesTypeExtension to handle non-array types (08bc696)
- Apply PHP CS Fixer fixes [skip ci] (d6548cc)
- Implement minimum coverage check in CI workflow and add new tests for JSON response handling (4454b7c)
- Update tests for error handling and response codes (b5f5501)
- Enhance AcroFormFieldEdit and update translations for field management (55c9469)
- Merge branch 'master' of github.com:nowo-tech/PdfSignableBundle (6d1e724)
- Update AcroForm documentation to clarify Python dependencies and backend requirements (2cb4174)
- Update documentation for AcroForm backend extension and installation requirements (1e014c2)
- Apply PHP CS Fixer fixes [skip ci] (1dc658c)
Release v2.0.1
Release v2.0.1
Changelog
Added
- Tests: More coverage for PDF.js loader (
getWorkerUrlabsolute URL conversion, protocol-relative and empty-string handling,querySelectorfallback whencurrentScriptis null;getPdfJsLibCDN path). PHP test for defaultpdfjs_worker_urlnull inSignatureCoordinatesType. Extraurl-and-scaletests (empty proxy,getScaleForFitPagewith null container).
Changed
- PDF.js worker: Default worker asset is now
pdf.worker.min.js(waspdf.worker.min.mjs) so typical servers serve it withContent-Type: application/javascript, avoiding “Failed to fetch dynamically imported module” and “Setting up fake worker” in development. Theme and loader default tobundles/nowopdfsignable/js/pdf.worker.min.js. Vite build copies the worker fromnode_modules/pdfjs-dist/buildto the output dir;copy-workerscript andpostinstallstill output the same file for installs without a full build. - Worker URL resolution: Relative worker URLs are converted to absolute (using
window.location.origin) so the worker loads correctly in SPAs and when the script is served from a different base. Fallback: whendocument.currentScripthas nosrc(e.g. lazy-loaded script), the loader looks for a script tag withsrccontainingpdf-signable.jsoracroform-editor.jsand derives the worker path from it.
Fixed
- Translations: Added missing AcroForm editor modal keys to 10 locales (ca, cs, de, fr, it, nl, pl, pt, ru, tr):
acroform_editor.modal_create_if_missing,modal_field_name,modal_field_name_placeholder,modal_hidden,modal_max_len,modal_max_len_placeholder. Ensuresmake validate-translationspasses. - Turkish (tr) YAML: Fixed invalid escape in single-quoted strings (
PDF\'deki→"PDF'deki alan adı") so the file parses correctly.
Documentation
- USAGE: Default worker asset and MIME-type note for “Setting up fake worker” / “Failed to fetch dynamically imported module”.
For upgrade steps from 2.0.0, see UPGRADING.
Commits
- Release version 2.0.1 with enhancements and fixes (df73ccc)
- Enhance PDF.js worker URL handling and add new tests (5f4b145)
- Merge branch 'master' of github.com:nowo-tech/PdfSignableBundle (e5c5616)
- Refactor AcroForm editor and enhance PDF worker integration (4bbaf30)
- Apply PHP CS Fixer fixes [skip ci] (81ee1fb)
Release v2.0.0
Release v2.0.0
Changelog
Breaking
- Configuration structure: Signature config must be under the
signaturenode (global box options +configsby alias). AcroForm config must be under a singleacroformnode (replacingacroform_editorandacroform_configs). Container parameters are renamed:nowo_pdf_signable.default_box_*,.configs→nowo_pdf_signable.signature.*;nowo_pdf_signable.acroform_editor.*,nowo_pdf_signable.acroform_configs→nowo_pdf_signable.acroform.*,nowo_pdf_signable.acroform.configs. See UPGRADING for migration steps and examples.
Added
- Signature config under
signaturenode: Global box defaults and named configs by alias (default aliasdefault). Use form optionconfig: 'alias'to apply. Container parameters:nowo_pdf_signable.signature.*andnowo_pdf_signable.signature.configs. See UPGRADING. - AcroForm config under single
acroformnode: Replacesacroform_editorandacroform_configs. Platform options, editor defaults,default_config_alias, andconfigsby alias. Container parameters:nowo_pdf_signable.acroform.*andnowo_pdf_signable.acroform.configs. See UPGRADING. - AcroForm editor translations: All UI strings in the AcroForm editor panel (demo templates) are now translatable. New translation keys under
acroform_editor.*(domainnowo_pdf_signable): page title, config header, form errors intro, close aria, panel title, draft intro (with HTML), document key label/placeholder, fields label, fields from PDF, refresh button, draft label/placeholder/title, load/save/clear buttons. Translations added for all 12 locales (EN, ES, FR, DE, CA, IT, NL, PT, CS, PL, RU, TR). Demo templatesacroform_editor.html.twig(Symfony 7 and 8) use|trans({}, 'nowo_pdf_signable')for every user-facing string. - AcroForm editor config (Type): New options under the
acroformnode to control the edit-field modal from the bundle config:label_mode('input'|'choice'): label as free text or select with predefined options plus "Other".label_choices(string[]): list of label options whenlabel_modeis'choice'(each entry: string or"value|Label").label_other_text(string): text for the "Other" option in the label select (default'Other').show_field_rect(bool, defaulttrue): whenfalse, the coordinates (rect) input is hidden in the edit-field modal.font_sizes(int[]): allowed font sizes in pt; empty = number input (1–72); non-empty = select with these values.font_families(string[]): allowed font families; empty = built-in list; non-empty = select with these options (each entry: string or"value|Label").
See CONFIGURATION and ACROFORM.
- Demo — AcroForm section: New dedicated "AcroForm" section in the demo nav and home index (Symfony 7 and 8) with six demos: AcroForm editor (default), AcroForm editor — Label as dropdown, AcroForm editor — Coordinates hidden, AcroForm editor — Custom font options, AcroForm editor — All options, AcroForm editor (min field size 24 pt).
- AcroForm apply — font family in PDF: The edit-field modal allows editing font size and font family for text/textarea fields. These values are now sent in the patch payload when applying to the PDF;
AcroFormFieldPatchincludesfontFamily; the Python apply script (apply_acroform_patches.py) sets the default appearance (/DA) with both font size and family, mapping common names (Arial, Helvetica, Times New Roman, Courier New, sans-serif, serif, monospace) to standard PDF fonts. See ACROFORM_BACKEND_EXTENSION and ACROFORM.
Changed
- (None.)
Fixed
- (None.)
Documentation
- Unified AcroForm docs: Single ACROFORM guide; ACROFORM_FLOWS for flow diagrams; ACROFORM_BACKEND_EXTENSION for backend. Removed redundant ACROFORM_EDITOR.md and ACROFORM_EDITOR_UX.md.
- Documentation in English: README, ACROFORM, ACROFORM_FLOWS, and EVENTS frontend section translated to English; ROADMAP updated with AcroForm section and doc links.
- Code comments in English: Spanish comments in
assets/acroform-editor.ts,assets/pdf-signable.scss, andscripts/PoC/run_poc.pytranslated to English.
For upgrade steps from 1.5.x, see UPGRADING.
Commits
Release v1.5.3
Release v1.5.3
Changelog
Added
- Extended debug logging: When
nowo_pdf_signable.debugistrue, the viewer script now logs more detail to the browser console to help detect template/override issues: DOM resolution (widget, boxes list, prototype, key elements), overlay updates (box item count, missing page/coordinate fields, missing overlay container per page), add box (empty prototype, missing root or page/coordinate inputs), remove box (index and remaining count; warning if clicked item is not a direct box-item), signature pads init (canvas count; warnings when box item or signature-data input is missing), and PDF DOM built (pages and overlay containers). See CONFIGURATION for thedebugoption.
Fixed
- Box item fallback: The script finds box rows by
[data-pdf-signable="box-item"]with fallback to.signature-box-item, so overridden themes that only use the class (e.g..signature-box-item) without the attribute still work and overlays are drawn correctly. USAGE notes the fallback.
Developer
- CHANGELOG, UPGRADING, and RELEASE checklist updated for 1.5.3.
For upgrade steps from 1.5.2, see UPGRADING.
Commits
Release v1.5.2
Release v1.5.2
Changelog
Added
- Workflow documentation: WORKFLOW.md with Mermaid diagrams for architecture, page load and init, load PDF, add signature box, drag/resize overlay, coordinate sync, and form submit. Linked from USAGE and README.
- Data attributes for overrides: The viewer script finds elements by
data-pdf-signableattributes (e.g.data-pdf-signable="widget","page","x") instead of CSS classes, so you can change or remove classes in overridden templates for styling without breaking the JS. Form types and theme add these attributes; USAGE documents the full table and override notes. - Recipe:
.symfony/recipeconfig file is a complete example with all options commented and explained in English.
Changed
- Override form theme: USAGE now explains that if the overridden form theme is not applied (form fields still from bundle), add the theme explicitly in
config/packages/twig.yamlunderform_themesso Twig uses your overridden template.
Fixed
- Widget init: Script finds the widget by
[data-pdf-signable="widget"]with fallback to.nowo-pdf-signable-widget, so overridden themes that do not add the attribute still work. - Page field on add box: When the page field is an input and the template override omits the expected class, the script now finds it by
[data-pdf-signable="page"]or by input/select whosenameends with[page], so the page number is set correctly when clicking on the PDF. - Mermaid diagrams: WORKFLOW.md sequence diagram labels simplified (no commas or special characters in arrow text) so Mermaid parsers accept them.
Developer
- CHANGELOG, UPGRADING, and RELEASE checklist updated for 1.5.2.
For upgrade steps from 1.5.1, see UPGRADING.
Commits
- Release version 1.5.2 with new features and improvements (bccc25f)
- Enhance PdfSignable bundle with data attributes for improved element targeting (2298a81)
- Update NowoPdfSignable bundle configuration with additional options and improved comments (8c724ae)
- Update documentation for template overriding in NowoPdfSignable bundle (7f71d73)
- Enhance documentation with template overriding instructions (53296b5)
Release v1.5.1
Release v1.5.1
Changelog
Fixed
- Named config merge order: When using a named config (e.g.
config: 'fixed_url'), the named config now overrides the form type’s resolver defaults. Previously the merge order was reversed, so options likeurl_field: false,show_load_pdf_button: false,unit_field: false, andorigin_field: falsefrom the YAML config were overwritten by the defaults and had no effect. If you use a named config with these options set tofalse, they now apply correctly (URL row, Load PDF button, and unit/origin selectors are hidden). - Form theme visibility: The Twig form theme now evaluates
url_field,show_load_pdf_button,unit_field, andorigin_fieldso that when they arefalse(or the string'false'), the corresponding UI is hidden. View options are passed as strict booleans frombuildViewfor consistent behaviour.
Changed
- Demo: The Symfony 7 and 8 demos’ Makefile forces
vendor/nowo-tech/pdf-signable-bundleto be a symlink to the mounted repo (/var/pdf-signable-bundle) aftercomposer install, so the container always uses the live bundle code. Path repository in the demos’composer.jsonhas"options": {"symlink": true}.
Developer
- Tests: New test
SignatureCoordinatesTypeTest::testNamedConfigWithHiddenFieldsOverridesDefaultsensures that a named config withurl_field,show_load_pdf_button,unit_field, andorigin_fieldset tofalseoverrides resolver defaults in both form building and view options. Presetfixed_urladded to the test form factory. TESTING updated (121 tests, coverage note for named config merge).
For upgrade steps from 1.5.0, see UPGRADING.
Commits
- Update demo configurations and enhance README for HTTPS support (b15328c)
Release v1.5.0
Release v1.5.0
Changelog
Added
- Guides and grid: Form options
show_grid(defaultfalse) andgrid_step(e.g.5in form unit). Whenshow_gridis true, a grid overlay is drawn on each page in the viewer (canvas above PDF, below signature overlays) to help align boxes; coordinates are unchanged. See USAGE and STYLES (.pdf-grid-overlay). - Viewer lazy load: Form option
viewer_lazy_load(defaultfalse). Whentrue, PDF.js and the signable script are not loaded at page bottom; a small inline script uses IntersectionObserver and loads them when the widget enters the viewport. Useful for long pages with multiple widgets. See USAGE. - Advanced signing (structure and extension points): Bundle now provides structures and events for PKI/PAdES, timestamp, audit trail, and batch signing without adding third-party dependencies. Your app adds keys, TSA URL, and signing service. See SIGNING_ADVANCED.
- Audit: Config
audit.fill_from_request(defaulttrue) mergessubmitted_at,ip,user_agentinto the model before dispatch.AuditMetadataclass with recommended keys (tsa_token,user_id, etc.). Config placeholderstsa_urlandsigning_service_id(bundle does not call them; use in listeners). - Events:
BATCH_SIGN_REQUESTED(when form is submitted with “Sign all”,batch_sign=1);PDF_SIGN_REQUEST(when your code requests a digital signature; listener can set response). See EVENTS. - Batch signing: Form option
batch_sign_enabledshows a “Sign all” button; your listener subscribes toBATCH_SIGN_REQUESTEDto perform the actual signing.
- Audit: Config
- Single inclusion of CSS and JS per request: When multiple
SignatureCoordinatesTypewidgets are rendered on the same page, the form theme includes the PDF viewer CSS (pdf-signable.css), PDF.js, andpdf-signable.jsonly once. A new Twig extension (NowoPdfSignableTwigExtension) exposesnowo_pdf_signable_include_assets()used by the theme. See USAGE and STYLES. - Demo: "Guides and grid" and "Viewer lazy load" demo pages (19 demos in total); sidebar and offcanvas highlight the current route; home index lists all demos including the new two.
Changed
- Larger resize and rotate handles: Corner resize handles on signature box overlays are now 12×12 px (was 8×8 px); the rotation handle is 16×16 px (was 12×12 px) for easier grabbing. See STYLES.
Fixed
- Rotated signature boxes: Drag constraints now use the axis-aligned bounding box of the rotated rectangle, so boxes can be moved flush to all page edges (left, right, top, bottom) at any rotation angle (e.g. -90°, 45°). Previously, rotated boxes could not be placed against the left (and sometimes top) edge.
Developer
- Tests:
NowoPdfSignableTwigExtensionTestcoversnowo_pdf_signable_include_assets()(true once per request, then false; no request → always true).BatchSignRequestedEventTestandPdfSignRequestEventTestadded;PdfSignableEventsTestextended withBATCH_SIGN_REQUESTEDandPDF_SIGN_REQUESTconstants. - Documentation: CONTRIBUTING documents form theme assets and the Twig function for overriders. TESTING updated with current coverage summary (120 tests) and exclusion of
PdfSignableEvents.php. - Coverage:
PdfSignableEvents.phpexcluded from coverage (constants only); phpunit.xml.dist and TESTING.md updated.
For upgrade steps from 1.4.x, see UPGRADING.
Commits
- Update documentation and prepare for version 1.5.0 release (cb00e8a)
- Enhance PdfSignable Bundle with new features and improvements (23c389a)
- Update RELEASE.md to reflect changes for version 1.4.1, including the correct upgrading instructions and checklist adjustments. (90550ea)
- Merge branch 'master' of github.com:nowo-tech/PdfSignableBundle (295f99c)
- Apply PHP CS Fixer fixes [skip ci] (1130b99)
Release v1.4.1
Release v1.4.1
Changelog
Fixed
- Translations: Added
signing.consent_labelandsigning.consent_requiredto all locales (CA, CS, DE, FR, IT, NL, PL, PT, RU, TR). Fixed YAML escaping in Catalan, French and Italian (single quotes in single-quoted strings). - Tests:
SignatureCoordinatesTypeTest::testEnableSignatureCaptureAndDisclaimerPassedToViewno longer submits the same form twice; uses a separate form instance for the null-consent assertion to avoidAlreadySubmittedException.