0

I am having a table in a HTML, in which the content in the table should be saved in MSword, MSexcel and pdf. For the content in the table if I give the font-size style as 10px, it is working in MSword, MSexcel files. But not working in PDF files. I defined the style as:

font-size: 10px;
Rajesh
  • 123
  • 2
  • 3
  • 14

3 Answers3

4

I think that font-size must be defined as pt instead of px for pdf:

font-size: 7.5pt;

for more information about pt see:

Should I use pt or px?

Community
  • 1
  • 1
kawashita86
  • 1,555
  • 3
  • 18
  • 25
1

Pixels are fixed-size units that are used in screen media (i.e. to be read on the computer screen).

AND

Points are traditionally used in print media (anything that is to be printed on paper, etc.). One point is equal to 1/72 of an inch. Points are much like pixels, in that they are fixed-size units and cannot scale in size.

so use pt instead of px

difference between font-size units when you see them in action

1em = 12pt = 16px = 100%
Sahil Popli
  • 1,967
  • 14
  • 21
0

Depending on the tool you are using for converting (I am guessing PHP), there is usually limited support for CSS. Please tell us how you plan to convert the HTML into PDF. I recommend using basic HTML tags such as <font> for styling your document

meewog
  • 1,690
  • 1
  • 22
  • 26