rsc / pdf

PDF reader
BSD 3-Clause "New" or "Revised" License
510 stars 327 forks source link

valid PDF file getting "not a pdf file missing %%EOF" while reading #28

Open giovapanasiti opened 6 years ago

giovapanasiti commented 6 years ago

I have this valid PDF which I can read and I can even parse it with nodejs. When I try to read it I get this:

not a PDF file: missing %%EOF

Any idea?

miguelpragier commented 4 years ago

I know it's too late, but for other's reference: I solved here passing the correct/exact file size in bytes:

    f,er4:=os.Open(targetDoc)
    fmt.Println(er4)
    fl,_:=f.Stat()
    r, er2 := rscpdf.NewReaderEncrypted(f, fl.Size(), func() string { return "" })