All nodes are only available on the hosted n8n version and require you to install CustomJS community package. See Installation.
The Compress Pages from PDF node allows you to compress PDF files using n8n. You can further extend this workflow to convert HTML or code into a PDF, compress the generated PDF, and return it as a binary response.