Basics
 
     

ABCpdf allows a range of HTML support for use when inserting multi-styled text. This can make it much easier to design documents and it can reduce the quantity of code required.

The HTML support offered here does not cover the entire HTML specification. It covers a limited range of the HTML specification as is required for styled text. It also extends the HTML specification to allow you to precisely control elements of style not covered by HTML.

 

   
Tags
 
       
 

You can add HTML to your documents using the AddHTML method. ABCpdf supports the following HTML tags and Attributes.

<Head>

This tag is used to delimit the head of an HTML document. All content in the head is ignored.

This tag does not accept any attributes.

<Body>

This tag is used to mark the body of an HTML document. The body is a type of stylerun and so it accepts the same attributes as a stylerun tag. It also accepts the following additional attributes.

Attribute   Notes
link

The color for links (anchors) in subsequent content.

Colors are generally specified as RGB in hexadecimal notation (eg color="#FF0000") or as one of the sixteen standard color names (eg color=red").

You can specify grayscale colors by supplying only one component (eg color="#80") and CMYK colors by supplying four (eg color="#10203040").

The default link color is RGB blue.

<BR>

This tag is used to force a line break.

This tag does not accept any attributes.

<P>

This tag is used to mark up paragraphs. Paragraphs are types of styleruns and so they accept the same attributes as stylerun tags. They also accept the following additional attributes.

Attribute   Notes
align

The text alignment for the paragraph. If no value is specified it is assumed that the text should be left aligned.

You can specify left aligned text (eg align=left), right aligned text (eg align=right), centered text (eg align=center) or justified text (eg align=justify).

Changing this attribute is identical to changing the Doc.HPos or XTextStyle.Justification properties.

break

The line breaking style for the paragraph. This attribute takes a comma delimited list of hints used to control how lines are broken when chaining from one text area to another.

You can specify that a paragraph should be kept with the next one by assigning the keepwithnext hint (eg break=keepwithnext). You can specify that there should be a break before a paragraph by specifying the breakbefore hint (eg break=breakbefore).

For details on chaining see the AddHTML function.

spacebefore

Normally paragraphs have vertical space before and afterwards the body text.

By setting this attribute to zero you can remove vertical space before the paragraph.

spaceafter

Normally paragraphs have vertical space before and afterwards the body text.

By setting this attribute to zero you can remove vertical space after the paragraph.

<H1> to <H6>

This tag is used to mark header sections. Headers are types of paragraphs and so they accept the same attributes as paragraph tags.

<List>

This tag is used to indicate a list of items. Each list item consists of a marker and some text. Markers may be bullet points, numbers or letters.

Lists are types of paragraphs and so they accept the same attributes as paragraph tags. They also accept the following additional attributes.

Attribute   Notes
itemindent

The indent of the item text from the left of the marker. This value is measured in points.

By altering this property you can change the distance between the marker and the text.

The default is dynamically determined based on the type of marker and the size of the text.

markerindent

The indent of the left of the marker from the current left of the surrounding text. This value is measured in points.

By altering this property you can alter the the indent distance for the markers in the list.

The default is dynamically determined based on the type of marker and the size of the text.

start

Specifies the starting number for the first item in the list.

This is only used when ordered markers are specified.

The default is one.

type

Specifies the type of marker to use. You can use either ordered markers or unordered markers.

Ordered markers increment for each item in the list. You can use numbers (type=1), lower case roman numerals (type=i), upper case roman numerals (type=I), lower case letters (type='a') or upper case letters (type=A).

Unordered markers are the same for each item in the list. You can specify bullet points (type=disk), hollow bullets (type=circle) or squares (type=square).

The default type is 'disk'.

<UL>

The UL tag is used to indicate an unordered list. Unordered lists are types of lists and so they accept the same attributes as list tags. The default marker is the bullet point but the marker will change as lists are nested within each other.

<OL>

The OL tag is used to indicate an ordered list. Ordered lists are types of lists and so they accept the same attributes as list tags. The default marker type is numeric.

<LI>

This tag is used to indicate an item within a list. It accepts the following attributes.

Attribute   Notes
value

Specifies the number for this list item.

Subsequent items are numbered incrementally from this new value.

type

Specifies the type of marker to use.

You can use the same types as you find in the type attribute of the list tag.

<A>

The anchor tag is used to mark subsequent content as a hyperlink. Anchors are types of styleruns and so they accept the same attributes as stylerun tags. They also accept the following additional attributes.

Attribute   Notes
href

The URL of the destination.

Hyperlinks normally appear as blue underlined text. You can override this style using the body link attribute or by using stylerun attributes in the body of your anchor tag.

<B>

This tag is used to apply a bold text style to subsequent content.

ABCpdf will attempt to reference an appropriate bold font. If it cannot locate one it will generate a synthetic bold style using the XTextStyle.Bold property.

This tag does not accept any attributes.

<I>

This tag is used to apply an italic text style to subsequent content.

ABCpdf will attempt to reference an appropriate italic font. If it cannot locate one it will generate a synthetic italic style using the XTextStyle.Italic property.

This tag does not accept any attributes.

<U>

This tag is used to apply an underline text style to subsequent content. The effect is identical to changing the XTextStyle.Underline property.

This tag does not accept any attributes.

<Strike>

This tag is used to apply an strike-through text style to subsequent content. The effect is identical to changing the XTextStyle.Strike property.

This tag does not accept any attributes.

<Sup>

This tag is used to indicate text to be rendered as superscript.

This tag does not accept any attributes.

<Sub>

This tag is used to indicate text to be rendered as subscript.

This tag does not accept any attributes.

<Font>

The font tag is used to change the current font style. Fonts are types of styleruns and so they accept the same attributes as stylerun tags. They also accept the following additional attributes.

Attribute   Notes
size

The font size for subsequent content.

You can set absolute font size by specifying an integer ranging from one to seven (eg size=6). Or you can specify a font size relative to the current base font size (eg size="+1").

For greater control over the size of text you should use the fontsize attribute.

color

The color for subsequent content.

Colors are generally specified as RGB in hexadecimal notation (eg color="#FF0000") or as one of the sixteen standard color names (eg color=red").

You can specify grayscale colors by supplying only one component (eg color="#80") and CMYK colors by supplying four (eg color="#10203040").

face

The font typeface for subsequent content.

This value takes a comma delimited list of typeface names, listed in order of preference. Fonts are referenced rather than embedded.

For greater control over the way that fonts are added to your document you should use the pid attribute.

<StyleRun>

The stylerun tag is used to change the current style. It accepts the following attributes.

Attribute   Notes
pid

The font typeface for subsequent content.

This attribute take an Object ID obtained from a previous call to AddFont or EmbedFont.

fontsize

The font size for subsequent content.

Changing this attribute is identical to changing the XTextStyle.Size property.

charspacing

The character spacing for subsequent content.

Changing this attribute is identical to changing the XTextStyle.CharSpacing property.

wordspacing

The word spacing for subsequent content.

Changing this attribute is identical to changing the XTextStyle.WordSpacing property.

justification

The justification for subsequent content.

Changing this attribute is identical to changing the XTextStyle.Justification property.

hpos

The horizontal positioning for subsequent content.

Changing this attribute is identical to changing the Doc.HPos property.

bold

Whether to apply a synthetic bold style to subsequent content.

Changing this attribute is identical to changing the XTextStyle.Bold property.

italic

Whether to apply a synthetic italic style subsequent content.

Changing this attribute is identical to changing the XTextStyle.Italic property.

underline

Whether to underline subsequent content.

Changing this attribute is identical to changing the XTextStyle.Underline property.

strike

Whether to apply a strike-through effect to subsequent content.

Changing this attribute is identical to changing the XTextStyle.Strike property.

strike2

Whether to apply a double strike-through effect to subsequent content.

Changing this attribute is identical to changing the XTextStyle.Strike2 property.

outline

Whether to outline subsequent content.

Changing this attribute is identical to changing the XTextStyle.Outline property.

linespacing

The line spacing for subsequent content.

Changing this attribute is identical to changing the XTextStyle.LineSpacing property.

paraspacing

The paragraph spacing for subsequent content.

Changing this attribute is identical to changing the XTextStyle.ParaSpacing property.

leftmargin

The left margin for subsequent content.

Changing this attribute is identical to changing the XTextStyle.LeftMargin property.

indent

The indent for subsequent content.

Changing this attribute is identical to changing the XTextStyle.Indent property.

fixedwidth

A fixed with for the style run.

Each style run has a width. The width is normally determined by the size of the characters in the text.

Under some situations it can be useful to assign a fixed width to the entire style run. This can be used for aligning text and for bullet pointed lists.

textrise

The text rise for subsequent content.

Positive values shift the text upwards. Negative values shift it downwards. The textrise distance is measured in points.

annots

Annotations associated with subsequent content.

You can use a link annotation to insert a hyperlink (eg annots='link:http://www.google.com/').

You can use a goto annotation to insert a link to another page in the document (eg annots='goto:3'). The number indicates the page number. Note that the destination page must exist at the point at which the text is inserted.

You can use a text annotation to insert a textual note (eg annots='text:A note to be inserted').

<BlockQuote>

This tag is used to indicate quotations. Block quotes are indented on the left and right relative to the surrounding text. The tag accepts the following attributes.

Attribute   Notes
leftindent

The left indent for the block of text.

Distances are measured in points. The default is 36.

rightindent

The right indent for the block of text.

Distances are measured in points. The default is 36.

 

   

 

Browser Based Help. Published by chm2web software.