The most reliable way to create a PDF from an .fprg file is directly through the official Flowgorithm application.

can handle batch conversions of various development file types. Flowgorithm Are you planning to build this as a web application desktop tool

Example quick workflows

In Flowgorithm, go to File > Export to Image File .