Jump to content
bzwirs

TAlphaColorRec in Android

Recommended Posts

Delphi 11.2

Winsoft PDFium

 

In app for Windows and Android I am using PDFium to create an invoice as a PDF.  Included In the PDF are 2 lines of text that are colored red and one rectangle filled with color blue.  Using PDFium I need to use TAlphaColorRec.Red and TAlphaColorRec.Blue to display the color on the PDF.  This works fine on Windows but when compiled for Android the text colour shows as blue and the rectangle fill color is red (ie. opposite of the selected colors).  Reversing the colors fixes the problem for Android but would appreciate if someone can please explain why this would happen.

 

Thanks

 

Bill Zwirs

Share this post


Link to post

For adding text with color (aDocketNum being a string variable):

 

FPdf1.AddText(aDocketNum, 'Arial', 14, 500, 755,TAlphaColorRec.Red);

 

For drawing a filled rectangle:

 

FPdf1.CreatePath(15, 550, fmAlternate,TAlphaColorRec.Blue, True, TAlphaColorRec.Black, 1.0);
FPdf1.LineTo(15, 576);
FPdf1.LineTo(577, 576);
FPdf1.LineTo(577, 550);
FPdf1.ClosePath;
FPdf1.AddPath;

 

FPdf1 is component supplied with Winsoft PDFium.

 

Bill

 

 

Share this post


Link to post
On 12/13/2022 at 2:15 PM, bzwirs said:

FPdf1.AddText(aDocketNum, 'Arial', 14, 500, 755,TAlphaColorRec.Red);

This command only works with Arial font!
I need it to work with non-English fonts like Arabic and Farsi

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×