Hi Francesco,
Here's the solution that I have now.
*******************************************
FUNCTION PdfXps2Pdf(cPdfXpsFile) //Convert PDF saved as XPS/PRN to PDF file
*******************************************
local cPdf,cOutFile,s
if cPdfXpsFile!=Nil .and. Hb_vfExists(cPdfXpsFile)
s:=Hb_MemoRead(cPdfXpsFile)
if ("PDF" $ s) //check if valid PDF
//Hb_Alert({cPdfXpsFile+" is a valid PDF file!"})
cPdf:=HB_StrReplace((cPdfXpsFile),{".oxps",".prn"},{".pdf",".pdf"}) //pdf output file
Hb_FNameSplit(cPdf, ,@cOutFile)
cOutFile:="file:///"+ Hb_StrReplace(GetEnv("USERPROFILE"),"\","/")+"/Documents/"+cOutFile+".pdf"
Hb_MemoWrit( cPdf, Hb_StrReplace( s,{chr(13)+chr(10)},{chr(10)} ) ) //replace CRLF with LF then write to cPdf
else
cOutFile:=cPdfXpsFile //open original file
endif
s:="" //reset
wapi_SHELLEXECUTE( 0,"Open" ,"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" ,'"'+cOutFile+'"', 0 , 1 )
endif
return nil
*******************************************************************************************************

Would appreciate if you suggest a cleaner and more generic approach?
Thanks,
Mario