A while back I wrote about two possible ways to export multiple layers in GIMP to one pdf file using third-party tools. But it turns out there is an much easier solution as Nevar pointed out in the comments on that blog post. The ‘Export Layers as PDF’ plugin for GIMP. You can get the plugin from the Gimp plugin registry. See here for instructions how to install the plugin.
After installing you need to restart GIMP after which you can find the new function in the file menu (see screenshot).
In the export window, you need to enter the name and location of the file. Don’t forget to add .pdf as extension, otherwise it will save the layers as separate png files. You furthermore have the option to save visible layers only and to flatten the image (which would give you the same result as the normal way to export your image to pdf).
It works like a charm, as you can see in the screenshot below. Just be aware that it, unfortunately, does not seem to export text. What I did was just merging the text to a new layer before exporting. It has been tested on Linux so your luck may vary on other operating systems.