Upvote:0
If you have all the paperwork for your Z visa, you can go to Hong Kong, and apply either directly, at the China Resources Building in Wanchai, or through a travel agency. Note that you won't be converting your spousal visa. You will ce cancelling it, and applying for a new visa, the Z visa.
However, as a Pakistani, you need a visa to go to Hong Kong. So I'm not sure it is worth the effort.
I have heard of travel agencies in Shenzhen, with partners/branches in HK, that can take your passport and documents, send it to HK, process the application, and return the passport with the visa and stamp. Not sure if that still works. Worth enquiring though.