What I would do is to manually put that rich text ...
# advancedpdf
a
What I would do is to manually put that rich text inside the PDF for testing and see if it render properly and debug it until it does...