Saltar al contenido principal

AddHTMLTextToDocument

Structure

AddHTMLTextToDocument(sDocFile, sHTMLText: String; iTop, iLeft, iWidth, iTransparency: Integer; bFirstPageOnly: Boolean): Char

Parameters

| Parameter | Type | Description
| sDocFile | String | the original file to be updatedsHTMLText | String | the HTML text to be addediTop | Integer | position of the text - topiLeft | Integer | position of the text - leftiWidth | Integer | Width of the text. Any remaining text will be drawn on a new line belowiTransparency | Integer | Transparency - percentage between 0 and 100bFirstPageOnly | Boolean | True or False - whether you would like the html text only added to the first page of the document or all pages |

Return Value

Char

'1' = Success, '0' = Failure. Success means the newly updated file exists

Description

Use this function to automatically add html text to a pdf file previously created. This text can be added to all pages, or only the first page, based upon last parameter. Note: position parameters are in units that are exactly 1/72 inches per unit, which is approximately the same as a "point", a unit used in the printing industry. 25.4 millimetres is one inch.

HTML Formatting - A limited HTML subset is supported:

<br> to break onto a new line

<b> or <strong> for bold

<i> or <em> for italics

<sup> and <sub> for superscript/subscript.

<u> for underline

<u> for double underline

<u> for strikeout (a line drawn through the text)

<u> for a line drawn above the text

<p align="left"> for left aligned paragraphs

<p align="center"> for centered paragraphs

<p align="justified"> for justified paragraphs

<ul>, <ol> and <li> for ordered/unordered lists

<a href="http://..."> for web links

<a href="https://..."> for web links

<a href="file://..."> for local file links

<font

size="__"

color="__"

background="__"

roundback="yes/no"

mode="__"

outlinecolor="__"

outlinewidth="__pt"

>

<span background="__" roundback="yes/no">

The font size can be specified as a standard HTML size, or a point size such as "11.5pt", the outline width must be specified in points, for example "1.5pt".

Text and background colors can be specified in RGB using the standard HTML hexadecimal notation, for example "#3A498C". CMYK colors can be specified using eight

hexadecimal values and omitting the #, for example "5C238F02".

If the roundback attribute is "yes", the background rectangles will be drawn with rounded edges.

Example

sHTMLText =

"<p align=""center"">" &

"Certificate is now:<br>" &

"<span background=""#FF0000"">" &

"<font size=""12"" color=""#FFFFFF"">" &

"<b><i> APPROVED </i></b>" &

"</font>" &

"</span><br>" &

"for details goto <u><a href=""http://www.indysoft.com""&gt;indysoft.com&lt;/a&gt;&lt;/u>" &

"</p>"

if AddHTMLTextToDocument(GetCurrentSignOffDoc, sHTMLText, 130, 240, 400, 0, True) = "0" then

ShowMessage("Document was NOT modified")

End If

HM_clip3003 |