Tutorial - HTML Formatted TextOut

Top  Previous  Next

In this tutorial you will create an application to insert HTML styled text into PDF documents.

 

[VB] 

 

' Load input file

PDFDoc.LoadFromFile (InputFile2)

' calling Textout

PDFDoc.TextOut "This file demonstrates the TextOut function of Gnostice PDFtoolkit ActiveX Control", 100, 200

PDFDoc.TextOutOnPage "This file demonstrates the TextOutOnPage function of Gnostice PDFtoolkit ActiveX Control", "1,2,3", 100, 300

' Save the Document

PDFDoc.SaveToFile (OutputFile)

 

 

 

[VC++] 

 

// Load Input file

PDFDoc.LoadFromFile(InputFile2);

// calling Textout With html formatted String

PDFDoc.TextOut("<Font Face = \"Comic Sans MS\" Size=12 Color = red> This file demonstrates the TextOut function of Gnostice PDFtoolkit ActiveX Control</Font>",100,200);

PDFDoc.TextOutOnPage("<Font Face = \"Verdana\" Size=10 Color = blue> This file demonstrates the TextOutOnPage function of Gnostice PDFtoolkit ActiveX Control</Font>","1,2,3",100,300);

// Save the Document

PDFDoc.SaveToFile(OutputFile);        

 

 

[CS]

 

// Load Input file

PDFDoc.LoadFromFile(InputFile2);

// This button click demonstrates the use of User Defined variables with OnCalcVariables Event.

// calling Textout with User Defined variable "TestVar"

PDFDoc.TextOut("<Font Face = \"Comic Sans MS\" Size=24 Color = red> Page <%PageNo%> My Test Variable is <%TestVar%> </Font>",100,200);

PDFDoc.OpenAfterSave = True;

// Save the Document

PDFDoc.SaveToFile(OutputFile);

 

See Also 'Tutorial - Using Variables in 'TextOut' and Text Watermark'