summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fpdf_test.go1
-rw-r--r--htmlbasic.go11
-rw-r--r--pdf/reference/Fpdf_HTMLBasicNew.pdfbin5610 -> 5664 bytes
3 files changed, 11 insertions, 1 deletions
diff --git a/fpdf_test.go b/fpdf_test.go
index 09346ff..456295c 100644
--- a/fpdf_test.go
+++ b/fpdf_test.go
@@ -470,6 +470,7 @@ func ExampleFpdf_HTMLBasicNew() {
htmlStr := `You can now easily print text mixing different styles: <b>bold</b>, ` +
`<i>italic</i>, <u>underlined</u>, or <b><i><u>all at once</u></i></b>!<br><br>` +
`<center>You can also center text.</center>` +
+ `<right>Or align it to the right.</right>` +
`You can also insert links on text, such as ` +
`<a href="http://www.fpdf.org">www.fpdf.org</a>, or on an image: click on the logo.`
html := pdf.HTMLBasicNew()
diff --git a/htmlbasic.go b/htmlbasic.go
index ee3be7d..9e4eca4 100644
--- a/htmlbasic.go
+++ b/htmlbasic.go
@@ -169,7 +169,7 @@ func (html *HTMLBasicType) Write(lineHt float64, htmlStr string) {
putLink(hrefStr, el.Str)
hrefStr = ""
} else {
- if alignStr == "C" {
+ if alignStr == "C" || alignStr == "R" {
html.pdf.WriteAligned(0, lineHt, el.Str, alignStr)
} else {
html.pdf.Write(lineHt, el.Str)
@@ -188,6 +188,12 @@ func (html *HTMLBasicType) Write(lineHt float64, htmlStr string) {
case "center":
html.pdf.Ln(lineHt)
alignStr = "C"
+ case "right":
+ html.pdf.Ln(lineHt)
+ alignStr = "R"
+ case "left":
+ html.pdf.Ln(lineHt)
+ alignStr = "L"
case "a":
hrefStr, ok = el.Attr["href"]
if !ok {
@@ -205,6 +211,9 @@ func (html *HTMLBasicType) Write(lineHt float64, htmlStr string) {
case "center":
html.pdf.Ln(lineHt)
alignStr = "L"
+ case "right":
+ html.pdf.Ln(lineHt)
+ alignStr = "L"
}
}
}
diff --git a/pdf/reference/Fpdf_HTMLBasicNew.pdf b/pdf/reference/Fpdf_HTMLBasicNew.pdf
index 587f2dc..bb88f2e 100644
--- a/pdf/reference/Fpdf_HTMLBasicNew.pdf
+++ b/pdf/reference/Fpdf_HTMLBasicNew.pdf
Binary files differ