easyPDF SDK Usermanual
PDF Creator Programming API  |  Download Free Trial  |  Contact Us to Purchase

AddTrueTypePDFText() Method

Adds a TrueType text entity to the PDF document's content.

Sub AddTrueTypePDFText(InputFileName As String,
                        OutputFileName As String,
                        FromPage As Long,
                        ToPage As Long,
                        Left As Double,
                        Top As Double,
                        Text As String,
                        Font As String,
                        FontSize As Double,
                        FontEmbedding As prcFontEmbedding,
                        Color As OLE_COLOR)

void AddTrueTypePDFText(string InputFileName,
                         string OutputFileName,
                         int FromPage,
                         int ToPage,
                         double Left,
                         double Top,
                         string Text,
                         string Font,
                         double FontSize,
                         prcFontEmbedding FontEmbedding,
                         System.UInt32 Color)

void AddTrueTypePDFText(String InputFileName,
                         String OutputFileName,
                         int FromPage,
                         int ToPage,
                         double Left,
                         double Top,
                         String Text,
                         String Font,
                         double FontSize,
                         prcFontEmbedding FontEmbedding,
                         int Color) throws PDFProcessorException


Return Values



Note 1: The page number uses a zero-based index, meaning that page numbering starts from 0.

Note 2: If Text contains Unicode characters, then font embedding is required. In this case, if FontEmbedding is PRC_FONT_EMBED_NONE (i.e. none), easyPDF SDK automatically overrides it to be PRC_FONT_EMBED_SUBSET (i.e. subset).

Note 3: OLE_COLOR conversion from various programming languages:


static_cast<OLE_COLOR>(RGB(0, 0, 255))


RGB(0, 0, 255)


Convert.ToUInt32(System.Drawing.ColorTranslator.ToOle(Color.FromArgb(0, 0, 255))


(uint)System.Drawing.ColorTranslator.ToOle(Color.FromArgb(0, 0, 255))


32 bit integer value in following format: 0x00bbggrr (in BGR format, not in RGB)

For more information about color translation, refer to MSDN Knowledge Base article Q131101.

Example Usage

Set oProcessor = CreateObject("easyPDF.PDFProcessor.8")
oProcessor.AddTrueTypePDFText "C:\test\input.pdf", _
                              "C:\test\output.pdf", _
                              0, _
                              1, _
                              2.0, _
                              2.0, _
                              "Added with AddTrueTypePDFText()", _
                              "Arial", _
                              16, _
                              PRC_FONT_EMBED_FULLSET, _
                              RGB(0, 0, 255)