Repository navigation
fix(print) centrer titre, ajuster marges, ajout sous-titre - #805
Merged
Merged
Conversation
alexisboyergauthier-msp
commented
Jan 27, 2021
Contributor
- marges changés pour le formulaire imprimé en fonction des normes du MERN
- titre centré horizontalement en fonction des marges
- Taille du titre ajustable en fonction du format de la page et de sa longueur
- Taille du titre réduit en général
- Titre mis en gras
- Ajout d'une boite de sous-titre, sa taille est définie a 70% de la taille du titre
pelord
reviewed
Jan 28, 2021
| const margins = [20, 10, 20, 10]; | ||
| const width = dimensions[0] - margins[3] - margins[1]; | ||
| const height = dimensions[1] - margins[0] - margins[2]; | ||
| const margins = [10, 10, 10, 10]; // modifier pour correspondre à normes MERN / dépends taille papier /top-bottom-left-right |
|
|
||
| let timeout; | ||
|
|
||
| // const scaleline = document.getElementsByClassName('ol-scale-line'); |
Member
There was a problem hiding this comment.
these comments should also be removed.
mbarbeau
requested changes
Jan 28, 2021
| const titleSize = Math.round(2 * (pageHeight + 145) * 0.05) / 2; | ||
| doc.setFont('Times'); | ||
| doc.setFontType('Bold'); | ||
| doc.setFontSize(titleFontSize); |
Member
There was a problem hiding this comment.
you use titleFontSize before its declaration
|
|
||
| // If scale need to be added to canvas | ||
| if (scale !== false) { | ||
| if (true) { |
mbarbeau
requested changes
Jan 28, 2021
| positionHCanvas = 30; | ||
| newContext.textAlign = 'center'; | ||
| newContext.fillText(title, width / 2, 20); | ||
| newContext.fillText(width, width / 2, 20, width * 0.9); |
Member
There was a problem hiding this comment.
Why width as the first parameter ?
The syntax of the function is:
void ctx.fillText(texte, x, y [, largeurMax]);
mbarbeau
reviewed
Jan 28, 2021
| newContext.font = '26px Calibri'; | ||
| positionHCanvas = 30; | ||
| newContext.textAlign = 'center'; | ||
| newContext.fillText(width, width / 2, 20, width * 0.9); |
Member
There was a problem hiding this comment.
Why width as the first parameter ?
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.