func ExampleFpdf_SVGBasicWrite() {
	const (
		fontPtSize = 16.0
		wd         = 100.0
		sigFileStr = "signature.svg"
	)
	var (
		sig gofpdf.SVGBasicType
		err error
	)
	pdf := gofpdf.New("P", "mm", "A4", "") // A4 210.0 x 297.0
	pdf.SetFont("Times", "", fontPtSize)
	lineHt := pdf.PointConvert(fontPtSize)
	pdf.AddPage()
	pdf.SetMargins(10, 10, 10)
	htmlStr := `This example renders a simple ` +
		`<a href="http://www.w3.org/TR/SVG/">SVG</a> (scalable vector graphics) ` +
		`image that contains only basic path commands without any styling, ` +
		`color fill, reflection or endpoint closures. In particular, the ` +
		`type of vector graphic returned from a ` +
		`<a href="http://willowsystems.github.io/jSignature/#/demo/">jSignature</a> ` +
		`web control is supported and is used in this example.`
	html := pdf.HTMLBasicNew()
	html.Write(lineHt, htmlStr)
	sig, err = gofpdf.SVGBasicFileParse(example.ImageFile(sigFileStr))
	if err == nil {
		scale := 100 / sig.Wd
		scaleY := 30 / sig.Ht
		if scale > scaleY {
			scale = scaleY
		}
		pdf.SetLineCapStyle("round")
		pdf.SetLineWidth(0.25)
		pdf.SetDrawColor(0, 0, 128)
		pdf.SetXY((210.0-scale*sig.Wd)/2.0, pdf.GetY()+10)
		pdf.SVGBasicWrite(&sig, scale)
	} else {
		pdf.SetError(err)
	}
	fileStr := example.Filename("Fpdf_SVGBasicWrite")
	err = pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
	// Output:
	// Successfully generated pdf/Fpdf_SVGBasicWrite.pdf
}
// ExampleFpdf_SVGBasicWrite demonstrates how to render a simple path-only SVG image of the
// type generated by the jSignature web control.
ExampleFpdf_SVGBasicWrite demonstrates how to render a simple path-only SVG image of the
type generated by the jSignature web control.
// ExampleFpdf_SVGBasicWrite demonstrates how to render a simple path - only SVG image of the // type generated by the jSignature web control .
func ExampleFpdf_SVGBasicWrite() {
	const (
		fontPtSize = 16.0
		wd         = 100.0
		sigFileStr = "signature.svg"
	)
	var (
		sig gofpdf.SVGBasicType
		err error
	)
	pdf := gofpdf.New("P", "mm", "A4", "") 
	pdf.SetFont("Times", "", fontPtSize)
	lineHt := pdf.PointConvert(fontPtSize)
	pdf.AddPage()
	pdf.SetMargins(10, 10, 10)
	htmlStr := `This example renders a simple ` +
		`<a href="http://www.w3.org/TR/SVG/">SVG</a> (scalable vector graphics) ` +
		`image that contains only basic path commands without any styling, ` +
		`color fill, reflection or endpoint closures. In particular, the ` +
		`type of vector graphic returned from a ` +
		`<a href="http://willowsystems.github.io/jSignature/#/demo/">jSignature</a> ` +
		`web control is supported and is used in this example.`
	html := pdf.HTMLBasicNew()
	html.Write(lineHt, htmlStr)
	sig, err = gofpdf.SVGBasicFileParse(example.ImageFile(sigFileStr))
	if err == nil {
		scale := 100 / sig.Wd
		scaleY := 30 / sig.Ht
		if scale > scaleY {
			scale = scaleY
		}
		pdf.SetLineCapStyle("round")
		pdf.SetLineWidth(0.25)
		pdf.SetDrawColor(0, 0, 128)
		pdf.SetXY((210.0-scale*sig.Wd)/2.0, pdf.GetY()+10)
		pdf.SVGBasicWrite(&sig, scale)
	} else {
		pdf.SetError(err)
	}
	fileStr := example.Filename("Fpdf_SVGBasicWrite")
	err = pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
}
func ExampleFpdf_SVGBasicWrite ( ) { const ( fontPtSize = 16.0 wd = 100.0 sigFileStr = " " ) var ( sig gofpdf . SVGBasicType err error ) pdf := gofpdf . New ( " " , " " , " " , " " ) pdf . SetFont ( " " , " " , fontPtSize ) lineHt := pdf . PointConvert ( fontPtSize ) pdf . AddPage ( ) pdf . SetMargins ( 10 , 10 , 10 ) htmlStr := `This example renders a simple ` + `<a href="http://www.w3.org/TR/SVG/">SVG</a> (scalable vector graphics) ` + `image that contains only basic path commands without any styling, ` + `color fill, reflection or endpoint closures. In particular, the ` + `type of vector graphic returned from a ` + `<a href="http://willowsystems.github.io/jSignature/#/demo/">jSignature</a> ` + `web control is supported and is used in this example.` html := pdf . HTMLBasicNew ( ) html . Write ( lineHt , htmlStr ) sig , err = gofpdf . SVGBasicFileParse ( example . ImageFile ( sigFileStr ) ) if err == nil { scale := 100 / sig . Wd scaleY := 30 / sig . Ht if scale > scaleY { scale = scaleY } pdf . SetLineCapStyle ( " " ) pdf . SetLineWidth ( 0.25 ) pdf . SetDrawColor ( 0 , 0 , 128 ) pdf . SetXY ( ( 210.0 - scale * sig . Wd ) / 2.0 , pdf . GetY ( ) + 10 ) pdf . SVGBasicWrite ( & sig , scale ) } else { pdf . SetError ( err ) } fileStr := example . Filename ( " " ) err = pdf . OutputFileAndClose ( fileStr ) example . Summary ( err , fileStr ) }
ExampleFpdf_SVGBasicWrite demonstrates how to render a simple path-only SVG image of the
type generated by the jSignature web control.
ExampleFpdf_SVGBasicWrite demonstrates how to render a simple path - only SVG image of the type generated by the jSignature web control .
// A4 210.0 x 297.0 // Output: // Successfully generated pdf/Fpdf_SVGBasicWrite.pdf