packages.flutter icon indicating copy to clipboard operation
packages.flutter copied to clipboard

[pdfx] Difference in PdfPage.render abstraction and implementation signatures that leads to performance loss

Open dkvyk opened this issue 1 year ago • 0 comments

Abstract PdfPage.render has an optional argument with default parameter format = PdfPageImageFormat.jpeg. However, PdfPageMethodChannel.render has the default value of format set to png. In the first place, this leads to rendering pages to png instead of jpeg (which is around 3 times slower in my case) if you omit the format parameter and will consider it jpeg (as abstraction signature states). In the second place, you must explicitly pass format = PdfPageImageFormat.jpeg to abstraction, which will trigger the avoid_redundant_argument_values linter rule (https://dart-lang.github.io/linter/lints/avoid_redundant_argument_values.html).

dkvyk avatar Jul 26 '22 14:07 dkvyk