When I export as PDF on LibreOffice I've got a poor image quality on all the images and all the documents I made.
I've checked the option "Lossless compression" on the export preferences.
I take the screenshots with Shutter.
Also I have a friend who shows me a PDF exported like I'm doing and their PDF looks awesome...
return $num % 2 == 0;
?