PDF Xpress for ActiveX - User Guide > How To > Modify PDF Document Content > Add Text to a PDF Document |
To add text to a PDF document, do the following:
VB6 Example |
Copy Code
|
---|---|
Private Sub Form_Load() Dim pdf As New PdfXpress pdf.InitializePaths "C:\Users\Public\Documents\Accusoft\PDFXpress\V7.0\Support\Font", _ "C:\Users\Public\Documents\Accusoft\PDFXpress\V7.0\Support\CMap" Dim doc As New PdfDocument doc.SetParentControl pdf doc.OpenDocument "C:\myfile.pdf", "" Dim options As New AddTextOptions options.FontSize = 14 options.FontWeight = PDF_FontWeight_Bold doc.AddText 0, options, "Hello World!" Dim so As New SaveOptions so.FileName = "C:\text.pdf" so.Linearized = True so.Overwrite = True doc.SaveDocument so Set so = Nothing Set options = Nothing Set doc = Nothing pdf.Terminate Set pdf = Nothing End Sub |