For a PDF, choose "Save as PDF" in the print dialog.
Get true-to-size lines
In the print dialog, set scale to 100% (or "Actual size"), not "Fit to page" - scaling shrinks the grid, so a 5 mm square would print smaller than 5 mm. If your printer cannot print to the edge, keep the normal margin; "No margin" can clip at the borders on some printers.