How to apply bold in a text snippet of a manually created PDF document?

0

I am developing a module responsible for generating and exporting documents in PDF (Reports). Since I did not find any third party free solution, then I'm using a simple VB library that puts the document header and sets some basic settings like font, paper size, and so on.

For the rest, I'm doing it in hand.

I would like to know how to apply bold in just a single text snippet of the PDF document. I noticed that people create a kind of source object in the "PDF / PostScript" code however it is tied to other objects and I do not know how to create it.

See PDF class documentation used .

    
asked by anonymous 31.01.2014 / 11:37

2 answers

2

ISSUE:

As explained in the comments the class VB2PDF link, but I will leave the library example

How to put bold in VB2PDF:

As can be seen in the site documentation itself, the objects in this class contain a FontType property that fits the text formatting, to make it bold just do as in the example:

Dim objPDF As New VB2PDF
With objPDF
 .PaperSize = pdfA4
 .FileName = "c:\temp\test.pdf"
 .StartPDF
 .WritePDF "Hello world !", True, .pdfBold
 .EndPDF
End With

This example should create a Hello World! with bold.

How to put bold in vbPDF:

You can change font styles such as seen here , just use the setFont method, by example :

Dim clPDF As New vbPDF 
With clPDF
  .BeginDoc
  If .ErrNumber = 0 then
    .BeginPage
    ' Aqui seta as opções de fonte (Família, tamanho, estilo)'
    .SetFont "Times", 24, .pdfBold
    .DrawText 1, 15, "Hello world !"
    .EndDoc
  End If
End With

I changed the example I made in the link a little, to include the bold.

    
31.01.2014 / 13:16
0

I found this page, which is the documentation of a library called VBPDF, is talking about how to use bold, italic and such ...

See: VBPDF set font

    
31.01.2014 / 13:14