I am trying to understand how the object ID are chosen in pdflatex or latex. Can someone please guide me to some documents or explain this question??? You'll need to look at the sources. This is not documented anywhere else, as far I know. https://tex.stackexchange.com/questions/385380/ has some links. Good luck! --karl