Web PDFDocument

I have a Web app that I have deployed to the cloud and have a problem with the statement -

Session.Document = New PDFDocument(PDFDocument.PageSizes.A4)

It works on the local web but when deployed to the cloud, it does not execute the statement and does not run any of the code following it. I am running verrsion 2022, Release 1.1

Thanks for any help.

You might have better luck if you move this question to the Web platform sub forum