PDF implementation of #1054 logic.