Skip to content

Commit 95286c3

Browse files
committed
add README.md with example code
1 parent 3213b62 commit 95286c3

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## gppdf
2+
golang wrap for wkhtmltopdf command.
3+
4+
## Example
5+
6+
```go
7+
package main
8+
9+
import (
10+
"fmt"
11+
"net/http"
12+
13+
"github.com/terryh/gopdf"
14+
)
15+
16+
func Pdfhandle(w http.ResponseWriter, r *http.Request) {
17+
result, err := gopdf.Url2pdf("http://nvd3.org/examples/stackedArea.html")
18+
fmt.Println(err)
19+
w.Header().Set("Content-Type", "application/pdf")
20+
w.Write(result)
21+
}
22+
23+
func main() {
24+
25+
http.HandleFunc("/", Pdfhandle)
26+
27+
http.ListenAndServe(":8080", nil)
28+
29+
}
30+
31+
32+
```
33+
34+
35+
36+

0 commit comments

Comments
 (0)