Stop loading external resources during html conversion to pdf

I have a problem with small html document conversions to PDF taking upwards of 30 minutes.

I believe it is due to LibreOffice trying to download external resources such as images but the servers don’t have access outside of the network.

Is there anyway we can stop these external resources from trying to be downloaded?

There is an option to break the links: Menu/Edit/Links.

Do you know if it possible to do this programmatically?

I think so, but I don’t know how. You can try recording a macro, to find out what basic instruction can do it.