Free Support Forum - aspose.com

How to Set Font using HTML 6 characters


#1

Is there a better method to set a font using the #CCCFFFF format?

This is what I have been using but seem a little long winded?

fragLine2.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb( System.Drawing.ColorTranslator.FromHtml(footerConfig.fontColor1 ));

Also is there a Convert Method (like in Aspose.Words ) to convert InchesToPoints()

Thank you in advance,


#2

@Toberville

Thank you for contacting support.

You are using color the right way and alternative approach may not be possible. Moreover, Aspose.PDF API does not expose such method, whereas the inches can be converted simply by multiplying with 72 because 1 inch equals 72 points.