func (r *PdfRenderer) RenderFooter(w io.Writer, ast *bf.Node) {
	r.tracer("RenderFooter", "Not handled")
}
RenderFooter is not supported.
package mdtopdf
import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strings"
	"github.com/jung-kurt/gofpdf"
	bf "github.com/russross/blackfriday/v2"
)
type Color struct {
	Red, Green, Blue int
}
type Styler struct {
	Font      string
	Style     string
	Size      float64
	Spacing   float64
	TextColor Color
	FillColor Color
}
type PdfRenderer struct {
	Pdf                *gofpdf.Fpdf
	orientation, units string
	papersize, fontdir string
	pdfFile, tracerFile string
	w                   *bufio.Writer
	mleft, mtop, mright, mbottom float64
	Normal Styler
	em     float64
	Link Styler
	Backtick Styler
	Blockquote  Styler
	IndentValue float64
	H1 Styler
	H2 Styler
	H3 Styler
	H4 Styler
	H5 Styler
	H6 Styler
	THeader Styler
	TBody   Styler
	cs states
}
func NewPdfRenderer(orient, papersz, pdfFile, tracerFile string) *PdfRenderer {
	r := new(PdfRenderer)
	r.pdfFile = pdfFile
	r.tracerFile = tracerFile
	r.orientation = "portrait"
	if orient != "" {
		r.orientation = orient
	}
	r.units = "pt"
	r.papersize = "Letter"
	if papersz != "" {
		r.papersize = papersz
	}
	r.fontdir = "."
	r.Normal = Styler{Font: "Arial", Style: "", Size: 12, Spacing: 2,
		TextColor: Color{0, 0, 0}, FillColor: Color{255, 255, 255}}
	r.Link = Styler{Font: "Arial", Style: "iu", Size: 12, Spacing: 2,
		TextColor: Color{0, 0, 0}, FillColor: Color{255, 255, 255}}
	r.Backtick = Styler{Font: "Courier", Style: "", Size: 12, Spacing: 2,
		TextColor: Color{37, 27, 14}, FillColor: Color{200, 200, 200}}
	r.H1 = Styler{Font: "Arial", Style: "b", Size: 24, Spacing: 5,
		TextColor: Color{0, 0, 0}, FillColor: Color{255, 255, 255}}
	r.H2 = Styler{Font: "Arial", Style: "b", Size: 22, Spacing: 5,
		TextColor: Color{0, 0, 0}, FillColor: Color{255, 255, 255}}
	r.H3 = Styler{Font: "Arial", Style: "b", Size: 20, Spacing: 5,
		TextColor: Color{0, 0, 0}, FillColor: Color{255, 255, 255}}
	r.H4 = Styler{Font: "Arial", Style: "b", Size: 18, Spacing: 5,
		TextColor: Color{0, 0, 0}, FillColor: Color{255, 255, 255}}
	r.H5 = Styler{Font: "Arial", Style: "b", Size: 16, Spacing: 5,
		TextColor: Color{0, 0, 0}, FillColor: Color{255, 255, 255}}
	r.H6 = Styler{Font: "Arial", Style: "b", Size: 14, Spacing: 5,
		TextColor: Color{0, 0, 0}, FillColor: Color{255, 255, 255}}
	r.Blockquote = Styler{Font: "Arial", Style: "i", Size: 12, Spacing: 2,
		TextColor: Color{0, 0, 0}, FillColor: Color{255, 255, 255}}
	r.THeader = Styler{Font: "Arial", Style: "B", Size: 12, Spacing: 2,
		TextColor: Color{0, 0, 0}, FillColor: Color{180, 180, 180}}
	r.TBody = Styler{Font: "Arial", Style: "", Size: 12, Spacing: 2,
		TextColor: Color{0, 0, 0}, FillColor: Color{240, 240, 240}}
	r.Pdf = gofpdf.New(r.orientation, r.units, r.papersize, r.fontdir)
	r.Pdf.AddPage()
	r.setStyler(r.Normal)
	r.mleft, r.mtop, r.mright, r.mbottom = r.Pdf.GetMargins()
	r.em = r.Pdf.GetStringWidth("m")
	r.IndentValue = 3 * r.em
	r.cs = states{stack: make([]*containerState, 0)}
	initcurrent := &containerState{containerType: bf.Paragraph,
		listkind:  notlist,
		textStyle: r.Normal, leftMargin: r.mleft}
	r.cs.push(initcurrent)
	return r
}
func (r *PdfRenderer) Process(content []byte) error {
	var f *os.File
	var err error
	if r.tracerFile != "" {
		f, err = os.Create(r.tracerFile)
		if err != nil {
			return fmt.Errorf("os.Create() on tracefile error:%v", err)
		}
		defer f.Close()
		r.w = bufio.NewWriter(f)
		defer r.w.Flush()
	}
	s := string(content)
	s = strings.Replace(s, "\r\n", "\n", -1)
	content = []byte(s)
	_ = bf.Run(content, bf.WithRenderer(r))
	err = r.Pdf.OutputFileAndClose(r.pdfFile)
	if err != nil {
		return fmt.Errorf("Pdf.OutputFileAndClose() error on %v:%v", r.pdfFile, err)
	}
	return nil
}
func (r *PdfRenderer) setStyler(s Styler) {
	r.Pdf.SetFont(s.Font, s.Style, s.Size)
	r.Pdf.SetTextColor(s.TextColor.Red, s.TextColor.Green, s.TextColor.Blue)
	r.Pdf.SetFillColor(s.FillColor.Red, s.FillColor.Green, s.FillColor.Blue)
}
func (r *PdfRenderer) write(s Styler, t string) {
	r.Pdf.Write(s.Size+s.Spacing, t)
}
func (r *PdfRenderer) multiCell(s Styler, t string) {
	r.Pdf.MultiCell(0, s.Size+s.Spacing, t, "", "", true)
}
func (r *PdfRenderer) writeLink(s Styler, display, url string) {
	r.Pdf.WriteLinkString(s.Size+s.Spacing, display, url)
}
func (r *PdfRenderer) RenderNode(w io.Writer, node *bf.Node, entering bool) bf.WalkStatus {
	switch node.Type {
	case bf.Text:
		r.processText(node)
	case bf.Softbreak:
		r.tracer("Softbreak", "Output newline")
		r.cr()
	case bf.Hardbreak:
		r.tracer("Hardbreak", "Output newline")
		r.cr()
	case bf.Emph:
		r.processEmph(node, entering)
	case bf.Strong:
		r.processStrong(node, entering)
	case bf.Del:
		if entering {
			r.tracer("DEL (entering)", "Not handled")
		} else {
			r.tracer("DEL (leaving)", "Not handled")
		}
	case bf.HTMLSpan:
		r.tracer("HTMLSpan", "Not handled")
	case bf.Link:
		r.processLink(node, entering)
	case bf.Image:
		r.processImage(node, entering)
	case bf.Code:
		r.processCode(node)
	case bf.Document:
		r.tracer("Document", "Not Handled")
	case bf.Paragraph:
		r.processParagraph(node, entering)
	case bf.BlockQuote:
		r.processBlockQuote(node, entering)
	case bf.HTMLBlock:
		r.processHTMLBlock(node)
	case bf.Heading:
		r.processHeading(node, entering)
	case bf.HorizontalRule:
		r.processHorizontalRule(node)
	case bf.List:
		r.processList(node, entering)
	case bf.Item:
		r.processItem(node, entering)
	case bf.CodeBlock:
		r.processCodeblock(node)
	case bf.Table:
		r.processTable(node, entering)
	case bf.TableHead:
		r.processTableHead(node, entering)
	case bf.TableBody:
		r.processTableBody(node, entering)
	case bf.TableRow:
		r.processTableRow(node, entering)
	case bf.TableCell:
		r.processTableCell(node, entering)
	default:
		panic("Unknown node type " + node.Type.String())
	}
	return bf.GoToNext
}
func (r *PdfRenderer) RenderHeader(w io.Writer, ast *bf.Node) {
	r.tracer("RenderHeader", "Not handled")
}