Automating PDF Creation Using Perl Executed Ghostscript

We have inherited the SDL XML Professional Publisher; current version (XPP) 9.2.0.0, software that has been installed, configured, and maintained by another company. We are learning as we go trying to analyse a complex corporate system and have gotten close to generating a first PDF file. Through the Pathfinder we can visually review the document and all looks good. We can also use it to convert the visualized document to a downloaded PDF. The problem we are having is in automating the production of this PDF.

Using a calling chain of shell scripts we are at the stage that a postscript file is being created. At that point
a Perl program takes over and uses ghostscript to generate the PDF. That step generates the PDF but it doesn't
reflect what we are seeing in Pathfinder. Besides the input .PS file and the output .PDF file the Perl program also
accepts an optional 'job option' file passed in through Ghostscript's -f option.

I have questions. What could be causing the disparity between the Pathfinder generated PDF file and the
Perl/Ghostscript version? Also, should I expect to be able to run ghostscript at the command line and get a
copy identical to what I can view and download from Pathdinder? If so what is the magic I am missing?

Thank you in advance for any advice.