Lay the piece of cut underlay on the floor, and make it flush to the doorway. Then mark 3mm in from the edge of the doorway. Draw an arrow onto the underlay to show the direction you need to cut, either left or right of the doorway.
Measure the width of the doorway and halve it. Then mark that distance out from the 3mm mark on your underlay. Use your level to draw a straight line from this mark to the top of the sheet. Then cut the underlay and lay it flush against the doorway.