Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Set text color for Table not working
  FAQ FAQ  Forum Search   Register Register  Login Login

Set text color for Table not working

 Post Reply Post Reply
Author
Message
cprins View Drop Down
Beginner
Beginner


Joined: 14 Dec 18
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote cprins Quote  Post ReplyReply Direct Link To This Post Topic: Set text color for Table not working
    Posted: 14 Dec 18 at 12:55PM
Hello,

I'm creating a table and I want to set the color of the first row to Blue with a White text
The other rows have a white background and a black text color
As soon as I set the text color to any value the text becoms invisible.

what is it that I'm doing wrong

 TableID:=pdf.qp.CreateTable(2, 4);
 pdf.QP.SetTableRowHeight(tableID, 1, 2, 5);
 pdf.QP.SetTableColumnWidth(tableID, 1, 1, 50);
 pdf.QP.SetTableColumnWidth(tableID, 2, 2, 100);
 pdf.QP.SetTableColumnWidth(tableID, 3, 4, 30);
 pdf.QP.SetTableCellBackgroundColor(tableID, 1, 1, 1, 4, 0.188, 0.329, 0.588);
 pdf.QP.SetTableCellAlignment(tableID, 1, 1, 1, 4, 4);
 pdf.QP.SetTableCellTextColor(TableID,1,1,2,4,0.9,0.9,0);
 pdf.QP.SetTableCellContent(tableID, 1, 1,'RegCode');
 pdf.QP.SetTableCellContent(tableID, 1, 2,'Omschrijving');
 pdf.QP.SetTableCellContent(tableID, 1, 3,'Van Datum');
 pdf.QP.SetTableCellContent(tableID, 1, 4,'Tot Datum');

 pdf.QP.SetTableCellContent(tableID, 2, 1,'024N300 00 02');
 pdf.QP.SetTableCellContent(tableID, 2, 2,'Temp.en rel.vocht logger');
 pdf.QP.SetTableCellContent(tableID, 2, 3,FormatDateTime('yyyy-mm-dd',now));
 pdf.QP.SetTableCellContent(tableID, 2, 4,'Tot Datum');
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 14 Dec 18 at 7:50PM
Hi CPrins,

don't have any experiences with table creation in pdf-documents.
Play a bit with the values you're using.
The B-value 0 seems a bit strange regarding the format of the other values.
Try it with the same format (x.xxx) like you're using for the background color...

Cheers and welcome here,
Ingo



Edited by Ingo - 14 Dec 18 at 7:51PM
Cheers,
Ingo

Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 24 Dec 18 at 11:08AM
Using:
pdf.QP.SetTableCellContent
focus on last parameter remember this is HTMLText
You could use:
'<font color="#FF0000">ANY TEXT</font>'
instead 'ANY TEXT'
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 24 Dec 18 at 11:33AM

; create table and setting all parameters
Local $iTableID = $oQP.CreateTable(5, 4); 5 rows 4 columns
$oQP.SetTableColumnWidth($iTableID, 1, 1, 10);
$oQP.SetTableColumnWidth($iTableID, 2, 2, 30);
$oQP.SetTableColumnWidth($iTableID, 3, 4, 70);
$oQP.SetTableRowHeight($iTableID, 1, 5, 0);
$oQP.SetTableCellPadding($iTableID, 1, 1, 5, 4, $__eQPDF_BORDERINDEX_All, 1);
$oQP.SetTableCellBackgroundColor($iTableID, 1, 1, 1, 4, 3, 10, 0);
$oQP.SetTableCellBackgroundColor($iTableID, 2, 1, 5, 4, 0, 10, 3);
$oQP.SetTableCellBorderColor($iTableID, 1, 1, 5, 4, 0, 1, 0, 2);
$oQP.SetTableCellBorderWidth($iTableID, 1, 1, 5, 4, $__eQPDF_BORDERINDEX_Top, 0.1);
$oQP.SetTableCellBorderWidth($iTableID, 1, 1, 5, 4, $__eQPDF_BORDERINDEX_Left, 0.1);
$oQP.SetTableCellBorderWidth($iTableID, 1, 4, 5, 4, $__eQPDF_BORDERINDEX_Right, 0.1);
$oQP.SetTableCellBorderWidth($iTableID, 5, 4, 5, 4, $__eQPDF_BORDERINDEX_Bottom, 0.1);
$oQP.SetTableCellAlignment($iTableID, 1, 1, 5, 1, $__eQPDF_CELLALIGNMENT_MiddleCenter);
$oQP.SetTableCellTextSize($iTableID, 1, 1, 5, 1, 20);

; fill a table with the contents of an array variable
; used the $ sSufix is to show how changes in a table format, in the case of variable-length text inserted into the table.
Local $sSufix = ''
For $iRow = 0 To UBound($aTable, 1) - 1
For $iCol = 0 To UBound($aTable, 2) - 1
If $iCol > 1 And $iRow > 0 Then
$sSufix = ' ' & _StringRepeat('<br>' & $aTable[$iRow][1], $iRow)
Else
$sSufix = ''
EndIf
$oQP.SetTableCellContent($iTableID, $iRow + 1, $iCol + 1, $aTable[$iRow][$iCol] & $sSufix)
Next
Next
$oQP.SetTableCellTextColor($iTableID,2,2,UBound($aTable, 1) - 1,UBound($aTable, 2) - 1,0.9,0.9,0)

; finally draw the entire table in the document
$oQP.DrawTableRows($iTableID, 20, 10, 200, 1, 0)


Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 24 Dec 18 at 11:40AM
I think that you should firstly set content and at the end use: QP.SetTableCellTextColor

Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store