Extract text from pdf while preserving the format

Hi Everyone,

There is a feature in the UiPath PDF activity to extract text while preserving the format. I want to use the same feature in my .net API. Can anyone guide how to achieve the same result?
I tried this library using iText.Kernel.Pdf. It’s not giving me output as expected. I want the same output as I get from UiPath. UiPath backend is also .net based. Can anyone help me with this?