4

I want to highlight the fact that I am using programmatically mPdf to do some specific writeText / writeCell, etc..

I need to simply increase font size when writing a specific text. Only for this.

How?

realtebo
  • 23,922
  • 37
  • 112
  • 189
  • have you checked and tried the answers on this [post](https://stackoverflow.com/questions/42916258/php-mpdf-impossible-to-set-font-family-and-font-size)? – MERLIN Jul 14 '21 at 08:25
  • Found an example in the documentation. https://mpdf.github.io/real-life-examples/letterhead-letters.html You can use html tags to change the font size. – Pasan Bhanu Guruge Jul 19 '21 at 16:41
  • @MERLIN: this example don't changes font size. Also, you can see a comment of mine of some months ago asking about font size – realtebo Jul 21 '21 at 11:19
  • @PasanBhanuGuruge: as state in the question, I am using mPdf programmatically. I'am creating PDF from scratch. Highly flexible and highly efficent. But I've the problem with the font size. I cannot understand if/how to create a new font specifying the size also – realtebo Jul 21 '21 at 11:20

1 Answers1

2

There is actually a public method for that, named SetFont. The problem with it is that it is completely undocumented, so it is unclear whether you’re actually supposed to use it, or it’s just an unstable implementation detail.

The documented API to accomplish this is to specify fonts and all other formatting information using HTML/CSS and then use the WriteHTML or WriteFixedPosHTML method to pass that to the mPDF library.

user3840170
  • 26,597
  • 4
  • 30
  • 62