Skip to content

Conversation

devsargam
Copy link
Collaborator

@devsargam devsargam commented Feb 10, 2024

Fixes: #55

This pr adds:

  • Functionality to download a notion file as pdf
  • Add a route at /pdf/.../... to convert notion doc to pdf
  • Add a visual button in AppBar component

My approach to this problem:

  • Load all the notion slides in a single page
  • Render the Appbar conditionally (don't render it on pdf)
  • Use the native window.print function to convert the html into PDF
  • Add a separate route under pdf/.../...

Copy link

vercel bot commented Feb 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
daily-code-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2024 8:15pm
daily-code-web-cyrh ❌ Failed (Inspect) Mar 18, 2024 8:15pm

@devsargam
Copy link
Collaborator Author

@hkirat could you please review it?

@devsargam
Copy link
Collaborator Author

My.Movie.mp4

@devsargam devsargam marked this pull request as ready for review February 10, 2024 19:23
@devsargam devsargam changed the title fix(ui): add a visual download button fix(ui): add a visual download PDF feature Feb 10, 2024
@devsargam
Copy link
Collaborator Author

@hkirat ping for attention. could you please review this??

@thatbeautifuldream
Copy link

thatbeautifuldream commented Feb 12, 2024

great work can you fix the file name as the page title?

@hkirat
Copy link
Collaborator

hkirat commented Feb 12, 2024

Hi so sorry not getting the time to review
/bounty $120
This loos great, will review later

@devsargam
Copy link
Collaborator Author

great work can you fix the file name as a the page title?

Yea, sure thanks for the suggestion

@mumin-khan
Copy link
Contributor

mumin-khan commented Feb 17, 2024

@devsargam Please ensure all content within toogle buttons is also printed in the pdf.
I think you missed on it.
I have cloned your branch and it doesn't work.

P.S: Even when I opened the toggle buttons, the code opens a new page for printing with all the toggle buttons closed. Also pdf doesn't support text search as well.

@devsargam
Copy link
Collaborator Author

@devsargam Please ensure all content within toogle buttons is also printed in the pdf.
I think you missed on it.
I have cloned your branch and it doesn't work.

P.S: Even when I opened the toggle buttons, the code opens a new page with all the toggle buttons closed. And pdf doesn't support text search as well.

Alright I'll work on it right now thanks for the bug

@devsargam
Copy link
Collaborator Author

@mumin-khan please check. I've fixed the solution now showing up issue now.

@mumin-khan
Copy link
Contributor

@mumin-khan please check. I've fixed the solution now showing up issue now.

@devsargam It works now.
Saving the pdf as microsoft print to pdf creates a non searchable pdf while as simple save as pdf creates a searchable one.
Adding a hint to select save as pdf may be useful.
image

Also the track and pdf routes have almost the same code. It would be better to refactor the code to avoid duplication.

@devsargam
Copy link
Collaborator Author

devsargam commented Feb 17, 2024

@mumin-khan please check. I've fixed the solution now showing up issue now.

@devsargam It works now.
Saving the pdf as microsoft print to pdf creates a non searchable pdf while as simple save as pdf creates a searchable one.
Adding a hint to select save as pdf may be useful.
image

Also the track and pdf routes have almost the same code. It would be better to refactor the code to avoid duplication.

  • Haven't faced such issues actually maybe because I'm on a mac
  • And regarding the same code it's actually a little different so I don't think it requires a refactor

@mumin-khan
Copy link
Contributor

mumin-khan commented Feb 17, 2024

@mumin-khan please check. I've fixed the solution now showing up issue now.

@devsargam It works now.
Saving the pdf as microsoft print to pdf creates a non searchable pdf while as simple save as pdf creates a searchable one.
Adding a hint to select save as pdf may be useful.
image
Also the track and pdf routes have almost the same code. It would be better to refactor the code to avoid duplication.

  • Haven't faced such issues actually maybe because I'm on a mac
  • And regarding the same code it's actually a little different so I don't think it requires a refactor

I would respectfully disagree with your opinion here.

I think you are passing the same problemDetail for all pages in a track.

@hkirat
Copy link
Collaborator

hkirat commented Mar 18, 2024

@devsargam can u fix the merge conflicts

@devsargam
Copy link
Collaborator Author

hey @hkirat, I've done my part.

@devsargam
Copy link
Collaborator Author

But it seem's there's something wrong with the requests directly from the main branch.
image

@hkirat
Copy link
Collaborator

hkirat commented Mar 18, 2024

merged in a few PRs, might've broken something

@devsargam
Copy link
Collaborator Author

or did u change something related to firebase or notion?

@devsargam
Copy link
Collaborator Author

Also, you can merge this @hkirat

@hkirat hkirat merged commit 2d2bdb3 into code100x:main Mar 18, 2024
@devsargam devsargam deleted the feat/add-download branch March 18, 2024 21:53
@AdiGaikwad
Copy link

Hey @devsargam
Can you check if it is working on https://projects.100xdevs.com/ ?
As it is giving me a blank page as pdf

@devsargam
Copy link
Collaborator Author

@AdiGaikwad yeppp, seems something is wrong I'm investigating

@devsargam
Copy link
Collaborator Author

But it does give correct for few cases right?

@AdiGaikwad
Copy link

@AdiGaikwad yeppp, seems something is wrong I'm investigating

I checked for 2 tracks both of them gave a blank page
I will check more

@thrishank
Copy link

Hey, @devsargam the solutions are not opening on the website. It's working locally but in the production, it doesn't
image

@devsargam
Copy link
Collaborator Author

There is a pr which hopefully fixes that @thrishank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add "save as pdf" feature for the slides
6 participants