Pay attention to the first code that represents the numbering of molecules in a scheme that is imported into LaTeX from the ".eps" file and by the command
pdflatex -shell-escape file1.tex
runs without any problems.
\documentclass{book}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{chemnum}
\usepackage{auto-pst-pdf}
\begin{document}
\begin{figure}
\centering
\replacecmpd{cmpd:1}
\replacecmpd{cmpd:2}
\replacecmpd{cmpd:3}
\includegraphics[width=1\textwidth]{CyAZIDES.eps}
\end{figure}
\begin{figure}
\centering
\replacecmpd{cmpd:1}
\replacecmpd{cmpd:2}
\replacecmpd{cmpd:3}
\replacecmpd{cmpd:4}
\includegraphics[width=1\textwidth]{CyAZIDES2.eps}
\end{figure}
\end{document}
The second code that was created using xepersian and by command
xelatex --shell-escape file2.tex
has been created that does not replace numbers correctly.
\documentclass{book}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{chemnum}
\usepackage{auto-pst-pdf}
\usepackage{xepersian}
\settextfont{Zar}
\begin{document}
\begin{figure}
\centering
\replacecmpd{cmpd:1}
\replacecmpd{cmpd:2}
\replacecmpd{cmpd:3}
\includegraphics[width=1\textwidth]{CyAZIDES.eps}
\end{figure}
\begin{figure}
\centering
\replacecmpd{cmpd:1}
\replacecmpd{cmpd:2}
\replacecmpd{cmpd:3}
\replacecmpd{cmpd:4}
\includegraphics[width=1\textwidth]{CyAZIDES2.eps}
\end{figure}
\end{document}