1

I have a system that automatically creates and saves documents as html. For further storage they ought to be pdfs though. I want to avoid having to do it manually so my preferred solution would be a small executable that I can call via command line, feed it with a source and output path (and ideally further parameters) and then let it do its magic. Something in concept like this:

exampleConverter.exe "C:\source\document1.html" "C:\convertedPDFs\document1.pdf"

No UI whatsoever, no human input, no popping up and closing console.

I looked through several options, but common problems I encountered were

  • the software is not free for commercial use
  • It is just a library of code, not a ready-to-go executable / code-base you just need to compile into one
  • The tool needs to get installed instead of being 'portable'

I'd like to avoid having to implement any modern libraries myself, partially for simple time concearns, partially because internally our code runs in a less than modern IE & VBS context so I for see compatibility problems. Simply triggering a precompiled executable through a generic command line inerface that I can trigger from vbs seems like the perfect solution here.

2 Answers 2

1

My question was perfectly answered on stackoverflow so I'll just link it here

https://stackoverflow.com/a/75342366/15227745

Turns out modern chromium based browsers already have an API where you can run it headless and do its conversion magic without actually having to see anything. For my purposes I can assume that every target PC runs a modern enough Windows, an dthat we set it up anyway, so the Edge path can supposed to be static.

0

Did you try pandoc? See e.g. this question for HTML -> PDF conversion. There are also more options listed on the pandoc website under "PDF".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.