It is thought possible this rhyme is a parody of an ode sung in synagogues during the first day of Pentecost which includes,
“Could we with ink the ocean fill ……..” and
“And were the skies of parchment made….”
The Koran also uses the same imagery in some passages and many folk songs throughout Europe have similar lines in them.
The rhyme first came to prominence in the reign of Charles I.
“If All the World Were Paper” Lyrics
If all the world were paper,
And all the sea were ink,
If all the trees were bread and cheese,
What would we have to drink?