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

Fix image size in PDF #226

Open
SankethBK opened this issue Oct 4, 2024 · 8 comments · May be fixed by #234
Open

Fix image size in PDF #226

SankethBK opened this issue Oct 4, 2024 · 8 comments · May be fixed by #234
Assignees
Labels
bug Something isn't working needs analysis There is no clear solution yet, need to research different possibilities

Comments

@SankethBK
Copy link
Owner

SankethBK commented Oct 4, 2024

Currently when a note containing image is exported into PDF, the image dimensions are retained from uploaded image and it fills up 2-3 pages in PDF.

For example this is the note

Pdf will be something like this

PDF is generated from exportNotesToPDF function which eventually calls preprocessDeltaForPDFExport function in lib/features/notes/data/repositories/export_notes_repository.dart. This function first converts delta format to HTML and then to PDF. We can access each delta element and its attributes inside this function. We need to edit the img tags generated in HTML to and add suitable height, width attributes so that the image doesn't span over multiple pages in PDF.

Relevant widgets

- packages/flutter_html_to_pdf/lib/flutter_html_to_pdf.dart
@SankethBK SankethBK added bug Something isn't working needs analysis There is no clear solution yet, need to research different possibilities labels Oct 4, 2024
@xkaper001
Copy link

Hi @SankethBK ,

I noticed that this issue is unassigned, and I'd love to work on it! I'm familiar with the technology used in this project and I believe I can help resolve it.

Could you please assign this issue to me?

Thank you!

@SankethBK
Copy link
Owner Author

Hi @xkaper001 , please go ahead

@vaishnavi-2301 vaishnavi-2301 linked a pull request Oct 8, 2024 that will close this issue
7 tasks
@vaishnavi-2301
Copy link

Hey @SankethBK, I took a look at the issue, and I believe I resolved it, kindly take a look at the pr. #234, and let me know if it needs to be modified.

@xkaper001
Copy link

@vaishnavi-2301 Don't you know you have to first get an issue assigned Then start working on it.
Also If someone else is already assigned to an issue then it means that they're already working on it, which means doing the same and submitting a PR fixing that issue will just waste time and work of the person assigned to that issue.

@vaishnavi-2301
Copy link

@vaishnavi-2301 Don't you know you have to first get an issue assigned Then start working on it. Also If someone else is already assigned to an issue then it means that they're already working on it, which means doing the same and submitting a PR fixing that issue will just waste time and work of the person assigned to that issue.

Hey @xkaper001,

I understand your concern, but this is an open-source project, which means anyone can contribute. I had already looked into this issue, worked on a solution, and submitted a PR before realizing it was assigned to you. You're welcome to take a look at my PR, and we can collaborate or build on it from there. Open-source contributions are meant to be collaborative, so I'm happy to discuss any changes or improvements!

@xkaper001
Copy link

Hey @xkaper001,

I understand your concern, but this is an open-source project, which means anyone can contribute. I had already looked into this issue, worked on a solution, and submitted a PR before realizing it was assigned to you. You're welcome to take a look at my PR, and we can collaborate or build on it from there. Open-source contributions are meant to be collaborative, so I'm happy to discuss any changes or improvements!

Yeah exactly an open source project means anyone can contribute. but think logically what exactly is the point of multiple people working on the same issue independently when only one's PR will get merged. That's not how open source works.

Again I am not saying your PR is wrong. but the approach is. Next time keep in mind to ask the maintainers to get the issue assigned to yourself or ask to collaborate on the issue if someone's already working on it. That's how open source works.

@SankethBK
Copy link
Owner Author

SankethBK commented Oct 8, 2024

Hey @xkaper001 and @vaishnavi-2301 , I truly appreciate the time and effort each of you has put into working on this issue.

@vaishnavi-2301 Thank you for working on this issue. I understand that since this is a small issue, you were probably experimenting with a POC and arrived at a solution. Having issues assigned before starting work is helpful to avoid overlap and ensure we use everyone's time effectively.

@xkaper001 If you haven't started working on this, you can review @vaishnavi-2301 's PR and collaborate to add any improvements if necessary. If you already have a working fix, feel free to submit your own PR. I'll review both.

I'll also be adding more issues today, so there will be plenty of opportunities for everyone to contribute.

@xkaper001
Copy link

xkaper001 commented Oct 8, 2024

Thanks @SankethBK, tho I had started working on this. one I'll prefer working on newer issues since this was already fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs analysis There is no clear solution yet, need to research different possibilities
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants