The Pentax AF540FGZ has a P5 Sync Port. This is similar in concept to the old standard X Sync (or PC Sync — that's Prontor/Compur) port, but not compatible. Unlike the X Sync cable, this provides full Pentax-specific communication just as if the flash were mounted on the hot shoe directly.
No Pentax dSLRs have the corresponding port on the camera side of things, so you need Pentax's "Hot Shoe Adapter F". And, for any flash which doesn't have the port, you can use the "Off-Camera Shoe Adapter F" to provide one. In either case, you'll need Extension Cord F5P, which comes in short (1m) and long (3m) varieties.