Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to bold a text in PDF?

Tags:

pdf

fonts

vb6

I'm developing a new function to "my" program. This function is able to write PDF files by the simple way, making a simple text file with some codes of PDF standard.

I'm trying to understand how it works yet, but my first problem is about how to apply bold on some line of my document.

I've already downloaded the PDF REFERENCES GUIDE, but I've not found nothing about it.

Any idea?

like image 540
Cleiton Ribeiro Avatar asked Oct 01 '22 19:10

Cleiton Ribeiro


1 Answers

PDF is not like HTML where you can apply formatting tags for emphasis. As you've read in the PDF reference, all that you do in PDF is to setup a graphics environment (colours used, fonts used, etc) and then put text on the page.

If you want to have something show in bold, use a font that is bold. If you want to have something show in italic, use a font that is italic.

Older software used dirty tricks to create "bold-alike" text, but the good (and easy) way to do it is to make sure you select the correct font before you start drawing text.

like image 107
David van Driessche Avatar answered Oct 05 '22 12:10

David van Driessche