Closed ArtemKor closed 5 years ago
Outstanding contribution, @ArtemKor! I will likely have questions over the next few days before I merge.
Many thanks for your excellent work and willingness to accommodate this project's license requirements.
This is really an awesome contribution @ArtemKor.
Can you make a couple small changes for attribution? Please add a copyright/license prefix to utf8fontfile.go. You can use the one in htmlbasic.go as a template, but use the current year, your name and email address. Also, please place a comment next to the untypedKeyMap definition and its methods in util.go. Something like
The untypedKeyMap structure and its methods are copyrighted 2019 by <your-name-here>.
Many thanks!
yo guys please merge this PR ;), i need to use this library for create reports in hebrew
While this gets resolved, you can use https://github.com/ArtemKor/gofpdf
While this gets resolved, you can use https://github.com/ArtemKor/gofpdf
i'm using go modules, i can't use it, it says
sh > go get github.com/ArtemKor/gofpdf@master
go: finding github.com/ArtemKor/gofpdf master
go: github.com/ArtemKor/gofpdf@v1.1.2-0.20190419140039-0d6a38d49d63: parsing go.mod: unexpected module path "github.com/jung-kurt/gofpdf"
go: error loading module requirements
sh > go get github.com/ArtemKor/gofpdf
go: github.com/ArtemKor/gofpdf@v1.1.1: parsing go.mod: unexpected module path "github.com/jung-kurt/gofpdf"
go: error loading module requirements
i'm using go modules
Perfect! Clone the artemkor fork:
mkdir artmekor
cd artemkor
git clone https://github.com/ArtemKor/gofpdf.git
mkdir example
cd example
Create the following files. go.mod
module example
go 1.12
require github.com/jung-kurt/gofpdf v1.2.0
replace github.com/jung-kurt/gofpdf => ../gofpdf
example.go
package main
import (
"fmt"
"os"
"github.com/jung-kurt/gofpdf"
)
func main() {
pdf := gofpdf.New("P", "mm", "A4", "")
pdf.AddPage()
pdf.AddUTF8Font("dejavu", "", "../gofpdf/font/DejaVuSansCondensed.ttf")
str := "לאכול קצת יותר אלה לחמניות צרפתית רכה לשתות תה"
pdf.SetFont("dejavu", "", 17)
pdf.SetXY(0, 100)
pdf.CellFormat(210, 25, str, "", 0, "CM", false, 0, "")
err := pdf.OutputFileAndClose("example.pdf")
if err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err)
}
}
Then build and run the executable:
go build -v
./example
cool seem to be working, but its switch the string from rtl to ltr
Hmm -- I would suggest opening an issue at github.com/ArtemKor/gofpdf but I don't see where that can be done. Is it just a matter of reversing the utf-8 runes in the string?
yes you are right if i will try to revers ruins it will work as accepted
I added copyrights and "right to left" languages support.
Great work, @ArtemKor. Many thanks.
Good job, @ArtemKor! Awesome news for me.
I am remastered the previous version. Removed all imports from tfpdf.php. Now we can keep the MIT license.