When I run the script, the resulting PDF only contains two pages when the colab notebook is much longer.