@Vinay Kumar Thank you reaching out to Microsoft Q&A. Apologize for the inconvenience caused any on this.
Based on the shared information, we have understood that if the incoming request url of web app which ends with .pdf
should be redirected to a different url. for that your regrex expression in the match condition should be in below format instead of above.
<rewrite>
<rules>
<rule name="Rewrite to article.aspx">
<match url="^(.*)\.pdf" />
<action type="Redirect" url="{R:1}" />
</rule>
</rules>
</rewrite>
I have tested this from my end it is working fine and I would suggest you validate it from your end as well.
Feel free to reach back to me if you have any further questions on this.