html – Can converting a virus-infected webpage to PDF format still contain viruses

So I know that PDF files can contain viruses themselves if they are target specifically for that purpose. However, my question for here is this: If a webpage that has some malicious scripts or a virus is converted into a PDF using one of the popular programmatic html to pdf conversion libraries (eg. in nodejs or python), and a user opens that PDF, is there any chance at all that the PDF itself is infected as well?