Exemple #1
0
func main() {
	pd := pdfread.Load(os.Args[1])
	_, d := pd.DecodedStream(util.Bytes(os.Args[2]))
	fmt.Printf("%s", d)

	/*
	   a := cmapi.Read(fancy.SliceReader(d));
	   fmt.Printf("\n%v\n%v\n%v\n", a, a.Ranges, a.Uni);
	*/
}
Exemple #2
0
func main() {
	if len(os.Args) == 1 || len(os.Args) > 2 {
		complain("")
	}
	pd = pdfread.Load(os.Args[1])
	if pd == nil {
		complain("Could not load pdf file!\n\n")
	}
	http.Handle("/hello", http.HandlerFunc(HelloServer))
	err := http.ListenAndServe(":12345", nil)
	if err != nil {
		panic("ListenAndServe: ", err.String())
	}
}
Exemple #3
0
func main() {
	pd := pdfread.Load(os.Args[1])
	if pd != nil {
		pg := pd.Pages()
		for k := range pg {
			fmt.Printf("Page %d - MediaBox: %s\n",
				k+1, pd.Att("/MediaBox", pg[k]))
			fonts := pd.PageFonts(pg[k])
			for l := range fonts {
				fontname := pd.Dic(fonts[l])["/BaseFont"]
				fmt.Printf("  %s = \"%s\"\n",
					l, fontname[1:])
			}
		}
	}
}
Exemple #4
0
func main() {
	if len(os.Args) == 1 || len(os.Args) > 3 {
		complain("")
	}
	page := 0
	if len(os.Args) > 2 {
		page = strm.Int(os.Args[2], 1) - 1
		if page < 0 {
			complain("Bad page!\n\n")
		}
	}
	pd := pdfread.Load(os.Args[1])
	if pd == nil {
		complain("Could not load pdf file!\n\n")
	}
	fmt.Printf("%s", svg.Page(pd, page))
}