func (t *TypeOneI) NewDic() (r []byte) { rs := fmt.Sprintf("D%d", t.DicNo) r = util.Bytes(rs) t.Dicts[t.DicNo] = new(DicT) t.Dicts[t.DicNo].Defs = make(map[string][]byte) t.Dicts[t.DicNo].Name = r t.DicNo++ return }
func main() { pd := pdfreader.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); */ }
func (t *TypeOneI) NewArray(size int) (r []byte) { r = util.Bytes(fmt.Sprintf("A%d", t.ArraNo)) t.Arrays[t.ArraNo] = make([][]byte, size) t.ArraNo++ return }
_ = a }, "currentdict": func(t *TypeOneI) { t.St.Push(t.DicSt[t.DicSp].Name) }, "currentfile": func(t *TypeOneI) { t.St.Push([]byte{'?'}) }, "def": func(t *TypeOneI) { a := t.St.Drop(2) t.DicSt[t.DicSp].Defs[string(a[0])] = a[1] }, "definefont": func(t *TypeOneI) { a := t.St.Drop(2) t.Fonts[string(a[0])] = string(a[1]) t.St.Push(util.Bytes("<FONT>")) // FIXME, we need this. _ = a }, "defineresource": func(t *TypeOneI) { a := t.St.Drop(3) t.St.Push([]byte{'?'}) _ = a }, "dict": func(t *TypeOneI) { a := t.St.Pop() t.St.Push(t.NewDic()) _ = a }, "dup": func(t *TypeOneI) { a := t.St.Pop() t.St.Push(a)
}, "'": func(pd *PdfDrawerT) { pd.Text.TNextLine() pd.Text.TShow(pd.Stack.Pop()) }, "BT": func(pd *PdfDrawerT) { pd.Text.TSetMatrix(nil) }, "ET": func(pd *PdfDrawerT) { }, "T*": func(pd *PdfDrawerT) { pd.Text.TNextLine() }, "TD": func(pd *PdfDrawerT) { a := pd.Stack.Drop(2) pd.TConf.SetLeading(util.Bytes(strm.Neg(string(a[1])))) pd.Text.TMoveTo(a) }, "TJ": func(pd *PdfDrawerT) { pd.Text.TShow(pd.Stack.Pop()) }, "Td": func(pd *PdfDrawerT) { a := pd.Stack.Drop(2) pd.Text.TMoveTo(a) }, "Tj": func(pd *PdfDrawerT) { pd.Text.TShow(pd.Stack.Pop()) }, "Tm": func(pd *PdfDrawerT) { a := pd.Stack.Drop(6) pd.Text.TSetMatrix(a)