in reply to download an array of text as pdf

There is no line in your code where you append each of the data points to the PDF object. Therefore it is no surprise that the resulting PDF doesn't contain the data.