# \*TOOLS/PRINTHTML Output Formatted Text from HTML

> Source: https://manual.pvxplus.com/utilities/printhtml

## Invocation

**CALL "\*tools/printhtml"**, *html$*, *outputchannel*, \[*left*\], \[*top*\], \[*right*\], \[*bottom*\]

***Where:***

|  |  |
| --- | --- |
| *html$* | HTML to convert to formatted text output. |
| *outputchannel* | Open channel to print the formatted text output to. |
| *left* | Left-most point of the area to print to. If not specified, use the current position. |
| *top* | Top-most point of the area to print to. If not specified, use the current position. |
| *right* | Right-most point of the area to print to. If not specified, use the maximum right point. |
| *bottom* | Bottom-most point of the area to print to. If not specified, use the maximum bottom point. |

## Description

Convert HTML input into formatted text output on the given open channel. This allows you to use a TinyMCE control for users to input formatted text and then allows you to output it to a PDF or other channel. To define a TinyMCE control, see **[Using the TinyMCE® HTML Editor](https://manual.pvxplus.com/extended-nomads-objects/tinymce-html-editor/using-the-tinymce-html-editor)**.

Only the most common HTML elements that are used to format text are supported with this tool:

| **HTML Element** | **Description** |
| --- | --- |
| \<h1> to \<h6> | Defines headings |
| \<b>  <br>\<strong> | Defines bold |
| \<i>  <br>\<em> | Defines italics |
| \<p> | Defines paragraphs |
| \<span> | Defines spans |
| \<br> | Defines line breaks |
| \<hr> | Defines horizontal lines |
| \<ul>  <br>\<ol>  <br>\<li> | Defines lists |
| Style attributes | Defines:  <br>  <br>Font  <br>Font size  <br>Text color  <br>Underlined text  <br>Horizontal text alignment |

*(The PrintHTML utility was added in PxPlus 2021.)*

## Example

This example code is for printing TinyMCE formatted text as a PDF:

```
open (hfn)"*PDF*;file=output_pdf$"
pdfChan=lfo
call "*tools/printHTML",tinyMCE.ctl'value$,pdfChan,1,1
close (pdfChan)
```

## See Also

**[\*TOOLS/ConvertHTMLColor](https://manual.pvxplus.com/utilities/converthtmlclr)**  
FIN **[CurFont](https://manual.pvxplus.com/functions/fin#curfont)** and **[CurColor (CurColour)](https://manual.pvxplus.com/functions/fin#curclr)**
