Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,34 +35,34 @@ To check some examples with the PDF output see [examples](examples/) folder.

## Supported tags & attributes

HTML tags:

- **a**: link
- **b**: bold
- **blockquote**: block quotation element
- **br**: new line
- **code**: inline code element
- **del**: strike-through
- **div**: block element
- **em**: italic
- **h1** - **h6**: headings
- **hr**: horizontal line
- **i**: italic
- **ins**: underline
- **img**: image
- **li**: list item
- **mark**: highlight
- **ol**: ordered list
- **p**: block element
- **pre**: preformatted text element
- **s**: strike-through
- **small**: smaller text
- **span**: inline element
- **strong**: bold
- **sub**: subscript element
- **sup**: superscript element
- **u**: underline
- **ul**: unordered list
HTML tags (using MDN definitions):

- **a**: the Anchor element
- **b**: the Bring Attention To element
- **blockquote**: the Block Quotation element
- **br**: the Line Break element
- **code**: the Inline Code element
- **del**: the Deleted Text element
- **div**: the Content Division element
- **em**: the Emphasis element
- **h1** - **h6**: the HTML Section Heading elements
- **hr**: the Thematic Break (Horizontal Rule) element
- **i**: the Idiomatic Text element
- **ins**: the added text element
- **img**: the Image Embed element
- **li**: the list item element
- **mark**: the Mark Text element
- **ol**: the Ordered List element
- **p**: the Paragraph element
- **pre**: the Preformatted Text element
- **s**: the strike-through text element
- **small**: the side comment element
- **span**: the generic inline element
- **strong**: the Strong Importance element
- **sub**: the Subscript element
- **sup**: the Superscript element
- **u**: the Unarticulated Annotation (Underline) element
- **ul**: the Unordered List element

CSS attributes (dimensional units are ignored and considered in pixel):

Expand Down
44 changes: 44 additions & 0 deletions examples/elements.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<title>Supported elements</title>
</head>
<body style="font-family: 'Times-Roman';">
tag A: <a href="https://www.google.com">link</a> <br>
tag B: <b>bold</b> <br>
tag Blockquote: <blockquote>block quotation element</blockquote>
tag Br: new line <br>
tag Code: <code>inline code element</code> <br>
tag Del: <del>strike-through</del> <br>
tag Div: <div>block element</div>
tag Em: <em>italic</em> <br>
tag H1: <h1>heading h1</h1>
tag H2: <h2>heading h2</h2>
tag H3: <h3>heading h3</h3>
tag H4: <h4>heading h4</h4>
tag H5: <h5>heading h5</h5>
tag H6: <h6>heading h6</h6>
tag Hr: horizontal line <hr>
tag I: <i>italic</i> <br>
tag Ins: <ins>underline</ins> <br>
tag Img: <img src="./examples/image.jpg" style="width: 100px"> image <br>
tag Mark: <mark>highlight</mark> <br>
tag Ol: <ol>
<li>ordered list</li>
<li>tag Li: list item (ordered)</li>
</ol>
tag P: <p>block element</p>
tag Pre: <pre>preformatted text element</pre>
tag S: <s>strike-through</s> <br>
tag Small: <small>smaller text</small> <br>
tag Span: <span>inline element</span> <br>
tag Strong: <strong>bold</strong> <br>
tag Sub: <sub>subscript element</sub> <br>
tag Sup: <sup>superscript element</sup> <br>
tag U: <u>underline</u> <br>
tag Ul: <ul>
<li>unordered list</li>
<li>tag Li: list item (unordered)</li>
</ul>
</body>
</html>
Binary file added examples/elements.pdf
Binary file not shown.
73 changes: 0 additions & 73 deletions examples/misc_elements.html

This file was deleted.

Binary file removed examples/misc_elements.pdf
Binary file not shown.
30 changes: 27 additions & 3 deletions examples/random_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@
<title>Random content</title>
</head>
<body style="font-family: 'Times-Roman';">
<h1>A test document <small>(with the supported elements)</small></h1>
This is <i style="color: #df2818">italic</i>, <u>underline</u> and <b>bold, <i>bold italic</i></b>
<h1>Random content <small>(with various elements and styles)</small></h1>

Test inline elements:
this is <i style="color: #df2818">italic</i>, <u>underline</u> and <b>bold, <i>bold italic</i></b>

<br />
<br />
<br />

<div>div element</div>
<div>div (2) element</div>
<span>span element</span>
<span>span (2) element</span>

<blockquote>The Block Quotation element</blockquote>

<hr style="color: #080" />

<div style="text-align: left">text-align: left</div>
Expand All @@ -26,7 +36,7 @@ <h1>A test document <small>(with the supported elements)</small></h1>
<hr/>

Begin of list
<ul style="margin-bottom: 20px">
<ul>
<li>Level 1a</li>
<li>Level 1b
<ul>
Expand All @@ -35,10 +45,13 @@ <h1>A test document <small>(with the supported elements)</small></h1>
<ul>
<li>Level 3a</li>
<li>Level 3b</li>
<li>Level 3c</li>
</ul>
</li>
<li>Level 2c</li>
</ul>
</li>
<li>Level 1c</li>
</ul>
End of list

Expand Down Expand Up @@ -86,10 +99,21 @@ <h3>More text</h3>
<hr />
<br />

This is an inline <code>code</code> element.
<pre> this is pre element </pre>
last line.

<div style="text-align: center">
An image:<br/>
<img src="./examples/image.jpg" style="width: 50%" />
</div>
<p>Some other paragraph</p>

<div style="color: red; position: absolute; top: 100px; left: 300px">
<em>Position: absolute</em>
</div>

<h2 style="break-before: auto">New page</h2>

<b>End of document</b>
</body>
Expand Down
Binary file modified examples/random_content.pdf
Binary file not shown.