rename pdf2d to draw2dpdf
This commit is contained in:
parent
96e73eab52
commit
dbd88a6569
8 changed files with 15 additions and 15 deletions
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2015 The draw2d Authors. All rights reserved.
|
// Copyright 2015 The draw2d Authors. All rights reserved.
|
||||||
// created: 26/06/2015 by Stani Michiels
|
// created: 26/06/2015 by Stani Michiels
|
||||||
|
|
||||||
// Package pdf2d provides a Graphic Context that can draw vector form on pdf file.
|
// Package draw2dpdf provides a Graphic Context that can draw vector form on pdf file.
|
||||||
package pdf2d
|
package draw2dpdf
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package pdf2d
|
package draw2dpdf
|
||||||
|
|
||||||
import "github.com/jung-kurt/gofpdf"
|
import "github.com/jung-kurt/gofpdf"
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// created: 26/06/2015 by Stani Michiels
|
// created: 26/06/2015 by Stani Michiels
|
||||||
// TODO: fonts, dpi
|
// TODO: fonts, dpi
|
||||||
|
|
||||||
package pdf2d
|
package draw2dpdf
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package pdf2d
|
package draw2dpdf
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -28,7 +28,7 @@ func ExampleGraphicContext() {
|
||||||
gc.FillStroke()
|
gc.FillStroke()
|
||||||
fmt.Println(gc.LastPoint())
|
fmt.Println(gc.LastPoint())
|
||||||
|
|
||||||
// pdf2d.SaveToPdfFile("example.pdf", pdf)
|
// draw2dpdf.SaveToPdfFile("example.pdf", pdf)
|
||||||
|
|
||||||
// Output:
|
// Output:
|
||||||
// 10 10
|
// 10 10
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2015 The draw2d Authors. All rights reserved.
|
// Copyright 2015 The draw2d Authors. All rights reserved.
|
||||||
// created: 26/06/2015 by Stani Michiels
|
// created: 26/06/2015 by Stani Michiels
|
||||||
|
|
||||||
package pdf2d
|
package draw2dpdf
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math"
|
"math"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// See also test_test.go
|
// See also test_test.go
|
||||||
|
|
||||||
package pdf2d_test
|
package draw2dpdf_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
// Package pdf2d_test gives test coverage with the command:
|
// Package draw2dpdf_test gives test coverage with the command:
|
||||||
// go test -cover ./... | grep -v "no test"
|
// go test -cover ./... | grep -v "no test"
|
||||||
// (It should be run from its parent draw2d directory.)
|
// (It should be run from its parent draw2d directory.)
|
||||||
package pdf2d_test
|
package draw2dpdf_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/llgcode/draw2d"
|
"github.com/llgcode/draw2d"
|
||||||
"github.com/llgcode/draw2d/pdf2d"
|
"github.com/llgcode/draw2d/draw2dpdf"
|
||||||
)
|
)
|
||||||
|
|
||||||
func test(t *testing.T, sample draw2d.Sample) {
|
func test(t *testing.T, sample draw2d.Sample) {
|
||||||
// Initialize the graphic context on an pdf document
|
// Initialize the graphic context on an pdf document
|
||||||
dest := pdf2d.NewPdf("L", "mm", "A4")
|
dest := draw2dpdf.NewPdf("L", "mm", "A4")
|
||||||
gc := pdf2d.NewGraphicContext(dest)
|
gc := draw2dpdf.NewGraphicContext(dest)
|
||||||
// Draw sample
|
// Draw sample
|
||||||
fn, err := sample(gc, "pdf")
|
fn, err := sample(gc, "pdf")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -26,7 +26,7 @@ func test(t *testing.T, sample draw2d.Sample) {
|
||||||
t.Skipf("Saving %q skipped, as it exists already. (Git would consider it modified.)", fn)
|
t.Skipf("Saving %q skipped, as it exists already. (Git would consider it modified.)", fn)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = pdf2d.SaveToPdfFile(fn, dest)
|
err = draw2dpdf.SaveToPdfFile(fn, dest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Saving %q failed: %v", fn, err)
|
t.Errorf("Saving %q failed: %v", fn, err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2015 The draw2d Authors. All rights reserved.
|
// Copyright 2015 The draw2d Authors. All rights reserved.
|
||||||
// created: 26/06/2015 by Stani Michiels
|
// created: 26/06/2015 by Stani Michiels
|
||||||
|
|
||||||
package pdf2d
|
package draw2dpdf
|
||||||
|
|
||||||
// Vectorizer defines the minimal interface for gofpdf.Fpdf
|
// Vectorizer defines the minimal interface for gofpdf.Fpdf
|
||||||
// to be passed to a PathConvertor.
|
// to be passed to a PathConvertor.
|
||||||
|
|
Loading…
Reference in a new issue