Skip to content

Commit

Permalink
Fixes in end of line handling in page contents
Browse files Browse the repository at this point in the history
  • Loading branch information
dslipak committed Oct 18, 2020
1 parent 4a7c662 commit e726c39
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# PDF Reader

A simple Go library which enables reading PDF files. Forked from https://github.com/rsc/pdf
A simple Go library which enables reading PDF files.

This repository contains merged code from https://github.com/rsc/pdf and https://github.com/ledongthuc/pdf

Features
- Get plain text content (without format)
- Get plain text content (without formatting)
- Get Content (including all font and formatting information)

## Install:
Expand Down Expand Up @@ -131,6 +133,3 @@ func readPdf(path string) (string, error) {
return "", nil
}
```

## Demo
![Run example](https://i.gyazo.com/01fbc539e9872593e0ff6bac7e954e6d.gif)
2 changes: 1 addition & 1 deletion page.go
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ func (p Page) Content() Content {
g.Tm = matrix{{1, 0, 0}, {0, 1, 0}, {tx, 0, 1}}.mul(g.Tm)
}
}
showText("\n")
//showText("\n")

case "TL": // set text leading
if len(args) != 1 {
Expand Down
2 changes: 2 additions & 0 deletions read.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ func (r *Reader) Trailer() Value {
if r == nil {
return Value{}
}

return Value{r, r.trailerptr, r.trailer}
}

Expand Down Expand Up @@ -343,6 +344,7 @@ func readXrefStreamData(r *Reader, strm stream, table []xref, size int64) ([]xre
}
}
}

return table, nil
}

Expand Down

0 comments on commit e726c39

Please sign in to comment.