How does "Export as JPG" work in LibreOffice Writer?

In OpenOffice Writer there is no option to export a document as JPG, only export as PDF. Therefore to make an image, first I have to convert the document as pdf, then convert the PDF to JPG. But if I make the resolution of image bigger than the PDF, the image quality detoriates.

In LibreOffice Writer, there is option to export the ODT directly to JPG. I just have to specify the resolution. But the best part is that the image quality does not detoriate.

How does LibreOffice achieve this? What does it do to maintain the quality? How can I do this outside LibreOffice?

Also posted at jpeg - How does "Export as JPG" work in LibreOffice Writer? - Unix & Linux Stack Exchange.