I have also struggled with this problem.
Finally, I found that if I drew an image with dpi meta, the image in the pdf generated by Microsoft Print To PDF would not be scaled.
There are a few libraries that can help do this (parse the image and edit the meta in it), but they're all too big. I tried to write two programs to add dpi meta to png and jpg. Maybe there are some bugs, but it worked for me.
jpg:
https://gist.github.com/DiamondMofeng/94a16775552cc10374d3a911242c4085
png:
https://gist.github.com/DiamondMofeng/9a54329842eea6306c8f6132cbeadae7