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.
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 callspreprocessDeltaForPDFExport
function inlib/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 theimg
tags generated in HTML to and add suitableheight
,width
attributes so that the image doesn't span over multiple pages in PDF.Relevant widgets