Print Page | Close Window

changing the font in a table cell

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1620
Printed Date: 28 May 25 at 8:37PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: changing the font in a table cell
Posted By: pdfOakleaf
Subject: changing the font in a table cell
Date Posted: 28 Oct 10 at 12:10PM
Is there any way to set the fontto use in a table

Although I change fonts in the main document I cant see how to do with within a table

any help will be much appreciated
Phil



Replies:
Posted By: Dimitry
Date Posted: 01 Nov 10 at 10:13PM

Table text is drawn using DrawHTMLText() engine. So you need to use a function like SetHTMLNormalFont() to select necessary font.

Here is code sample that shows how to draw several tables using different fonts:
 
// QPL: TQuickPDF;
var
  table: Integer;
  f1, f4, f10, f12: Integer;
begin
  with QPL do
  begin
    SetOrigin(1);
    f1 := AddStandardFont(1);
    f4 := AddStandardFont(4);
    f10 := AddStandardFont(10);
    f12 := AddStandardFont(12);
 
    table := CreateTable(2, 2);
    SetTableColumnWidth(table, 1, 2, 70);
    SetTableRowHeight(table, 1, 2, 30);
    SetTableCellContent(table, 1, 1, 'SOME TEXT');
    SetTableCellContent(table, 1, 2, 'SOME TEXT');
    SetTableCellContent(table, 2, 1, 'SOME TEXT');
    SetTableCellContent(table, 2, 2, 'SOME TEXT');
 
    SetHTMLNormalFont('Default', f1);
    DrawTableRows(table, 50, 50, 1000, 1, 0);
    SetHTMLNormalFont('Default', f4);
    DrawTableRows(table, 250, 50, 1000, 1, 0);
    SetHTMLNormalFont('Default', f10);
    DrawTableRows(table, 50, 150, 1000, 1, 0);
    SetHTMLNormalFont('Default', f12);
    DrawTableRows(table, 250, 150, 1000, 1, 0);
  end;
end;


-------------
Regards,
Dmitry


Posted By: pdfOakleaf
Date Posted: 02 Nov 10 at 1:23PM
thanks for letting me know - I'll have a play with these functions and I'm sure I'll get everything I need

thanks again
Phil



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk