feat: per-document signature position picker#19
Closed
mborchuk wants to merge 1 commit into
Closed
Conversation
When signing a document PDF with visual signature, instead of using the global position from Settings, user now sees a position picker page: - Choose page (first, last, or specific page number) - Choose position (6 presets with visual preview) - Visual guide shows where signature will be placed Changes: - pdf_signature: _apply_visual_signature accepts position/page_num overrides - pdf_signature: new routes sign_file_picker (GET) and sign_file_apply (POST) - pdf_signature: visual capability has has_position=True flag - document_view: visual sign button links to picker instead of direct POST - Digital signatures still use direct POST (no position needed)
| signers = module.core.module_manager.find_capabilities('pdf_sign') | ||
| if cap_index < 0 or cap_index >= len(signers): | ||
| flash('Signing method not available.', 'danger') | ||
| return redirect(back_url) |
| ).fetchone() | ||
| if not row: | ||
| flash('File not found.', 'danger') | ||
| return redirect(back_url) |
| result = module.core.storage.get(file_path) | ||
| if not result: | ||
| flash('File not found in storage.', 'danger') | ||
| return redirect(back_url) |
| module.logger.error('Sign file error: %s', e) | ||
| flash('Signing failed. Check server logs.', 'danger') | ||
|
|
||
| return redirect(back_url) |
| try: | ||
| reader = _PdfReader(io.BytesIO(result[0])) | ||
| page_count = len(reader.pages) | ||
| except Exception: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Visual signature on documents now opens a position picker page instead of signing with the global position. Choose page number and position (6 presets with visual guide). Digital signatures still apply directly.