Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for zooming in and out for PrintPreview component #8323

Closed
2 tasks
Tracked by #8275
rithviknishad opened this issue Aug 14, 2024 · 4 comments · Fixed by #8487
Closed
2 tasks
Tracked by #8275

Support for zooming in and out for PrintPreview component #8323

rithviknishad opened this issue Aug 14, 2024 · 4 comments · Fixed by #8487
Assignees
Labels
good first issue Good for newcomers

Comments

@rithviknishad
Copy link
Member

rithviknishad commented Aug 14, 2024

Is your feature request related to a problem? Please describe.
Currently the PrintPreview component does not support zooming in and out.

Also, it is not mobile friendly as the print preview in mobile feels large as it maintains a minimum width as per the print for ~A4 sizes while ensuring the text / other contents are sized correctly.

Describe the solution you'd like

  • Add support for zoom in/out for PrintPreview component by scaling the div of id=section-to-print element as per the zoom value.

  • Default the zoom value to normal in desktop view, however, default it to a smaller value (as fitting) for mobile view.

You can use useBreakpoint hook to achieve that.

Refer how zoom is implemented in another similar place: https://github.com/coronasafe/care_fe/blob/develop/src/Components/Common/FilePreviewDialog.tsx#L10-L19

Example usage of Print Preview can be observed here: https://care.ohc.network/facility/0c95c7f0-e1d2-4aff-83fa-933cef60d3a8/patient/7e8fc20f-02da-47f7-8c33-f2d8c7e52dd8/consultation/edfe0bd6-0f50-4a4c-8cd0-2d4ad0e9cea1/prescriptions/print

image
@ayushpatil2122
Copy link

I want to work on this issue

@ayushpatil2122
Copy link

@rithviknishad
Screenshot 2024-08-16 020422
is this ok for mobile view

@rithviknishad
Copy link
Member Author

@ayushpatil2122 Do not make the contents of the preview responsive based on screen size. This will lead to mismatch between the print output and preview. Instead just default the zoom scale level to a smaller value.

@rithviknishad
Copy link
Member Author

@ayushpatil2122 Unassigning due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: Done
2 participants