Creating (producing) PDF with layers from Revit, using Print to PDF option is, unfortunately, not possible.
The solution, however, is simple. If you have AutoCAD.
Let’s say you have Revit view or sheet that you want to have in PDF with layers so they can be turned on/off appropriately. The procedure to achieve this is simple:
1. Export your Revit view or sheet to DWG file format (make sure you have appropriate Layer key assigned so Revit categories are put into valid DWG layers).
2. Use AutoCAD to open exported DWG.
3. Choose print option in AutoCAD to print model or layout view (Ctrl+P), select “DWG To PDF.pc3” printer from printer Name dropdown menu.
4. Click on “PDF Options…” button and make sure “Include layer information” checkbox is checked (it should be checked by default).
5. Set other options appropriately (sheet size, scale, plot style etc.)
6. Click “Preview” button and choose print if preview is correct.