I build windows apps using lazarus. Can I use Brave in the background to silently convert an .html file to a .pdf file?

Lazarus uses FreePascal. I was hoping I could, in my program, (with Brave installed of course) do something like this:

procedure TMainForm.btnConvertToPDF.OnClick(Sender: TObject);
if RunCommand(brave.exe, “SaveAsPDF”, myinputfile.html, myoutputfile.pdf ) then
ShowMessage(‘File saved to .Pdf’)
ShowMessage(‘There was a problem’);

Is this possible? Thanks for any help you can provide.

I think it should be possible.

Does Brave do that now? If so, what is the code snippet to make
it work?