This project is a great match for what you want to do.
Blog describing the project: https://www.pdftron.com/blog/react/react-to-pdf/
Disclaimer this is from my company, but the web-to-pdf project is GNU AFFERO GENERAL PUBLIC LICENSE and allows commercial use.
If you open your file in Preview you will get several options. Select export from under the File menu and you can save the PDF file as jpeg, jpeg2000, png, tiff. You can also resave it as a PDF with an option to reduce size.
You can use Syncfusion .Net PDF library to create, read, and edit PDF documents programmatically.
With this library you can convert HTML,Word and Images to PDF.
Please find the some helpful links to get started.
HTML to PDF conversion
Word to PDF conversion
Image to PDF conversion
To find more details refer the PDF help documentation.
(Disclosure: I'm ...
If you are looking for a searchable PDF automation solution, please have a look at OCRvision. If you configure the network scanner output folder as a magic folder OCRvision is free for personal use. You need to buy a license if you are planning to use this software for a commercial purpose.