Hi @joeri
Are you writing raster or vector features to the PDF? Have you tried enabling the PDF 1.4 compatibility parameter in the writer parameters? The PDF writer should only be writing out a layer for each writer feature type you have on the canvas so it might be helpful to narrow down which layer is causing the issue(s).
I imagine there are no warnings/errors being reported in the log file... but if there are, could you please post the warning message?
PDF always needs at least one layer, so you can effectively flatten a PDF by writing everything to the same layer (and relying on the sort order to make sure everything comes up in the correct order).
Writing a combination of raster and vector which I've added to one PDFPageFormatter, so resulting in 1 layer.
When I open the pdf in Acrobat Reader it shows the 1 layer:
So this opens correct in Acrobat, but opening this pdf in e.g. Firefox is not possible.
When I use Ghostscript (or an online tool (search on Flatten PDF Online)), no layers are shwon anymore and opening in a webbrowser becomes possible.