We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to read TextState.FontStyle?

I would like to read from a TextFragment.TextState.FontStyle to see if it’s Italics or not. But the FontStyle property only has a setter. Is there another way to check if a TextFragment is italicized?


Thanks for contacting support.

We have already logged an enhancement request as PDFNET-45366 to implement getter for the property of FontStyle. We have linked the request with this thread as well, so that you can receive notifications once the feature is available. Please be patient and spare us little time.

We are sorry for the inconvenience.

This still doesn’t appear to have been fixed?

Any idea where this sits in the priority list (i.e. This has been 1 year), as this is a fairly breaking bug for writing any form of theming components where you need to read the FontStyle. Will this thread be updated once that ticket is resolved?

I appreciate this is free support, but this sort of issue is incredibly trivial.

I am finding more of these sort of issues in the library and I am worried that either items are never resolved, or items are being regressed, which is cause for concern.

Is there any documented work around?

Probably also worth noting that Setter only properties are considered bad design, and should be avoided: https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/property?redirectedfrom=MSDN

Edit: I dont believe there is any workaround for this. I have even tried reflection on the object to manually interrogate the object but as you have explicitly removed the getter it’s not working.

I even tried a “reverse merge” approach where I just accept the new TextState, and then re-append the old properties, but the TextState doesn’t have a setter, so can’t do this either

Thanks for following up. Aspose is definitely a hard interface to work with. Upgrades usually break something and it seems like their developers don’t even talk together - the switching between number formats is annoying - double vs float, etc. I wish I could find an alternative product to create PDFs.

@R_C_D_T, @dirq

Thanks for sharing your concerns.

We apologize for the delay and inconvenience faced. We have recorded you concerns and also raised to priority of earlier logged ticket. We will surely consider all of your concerns during ticket investigation and implementation of required feature. We greatly appreciate your comprehension and patience in this regard.

We will surely let you know as soon as we make some significant progress towards ticket resolution. Please spare us little time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-45366) have been fixed in Aspose.PDF for .NET 19.11.