jung-kurt / gofpdf

A PDF document generator with high level support for text, drawing and images
http://godoc.org/github.com/jung-kurt/gofpdf
MIT License
4.34k stars 787 forks source link

Rotate text (not page) #183

Closed tj-kev closed 6 years ago

tj-kev commented 6 years ago

I'm trying to rotate text using the following code:

    pdf.TransformBegin()
    pdf.TransformRotate(90, 0, 0)
    pdf.CellFormat(40, 10, "my text", "", 0, "C", false, 0, "")
    pdf.TransformEnd()

This is in multiple locations on the page.

Should transformations be taken independently between each transform begin and end? Looks like it is rendering all the cells and then applying the transformation as one. Rotating the entire page instead of each cell independently?

Is there a way to achieve this?

jung-kurt commented 6 years ago

Looks like it is rendering all the cells and then applying the transformation as one. Rotating the entire page instead of each cell independently?

This result surprises me. The PDF generated by this example transforms only the content generated between TransformBegin() and TransformEnd().

tj-kev commented 6 years ago

Its ok, my bad.

Some confusion with the x,y. Great library btw!