Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_error not defined #78

Closed
sebastianpech opened this issue Nov 26, 2019 · 11 comments
Closed

_error not defined #78

sebastianpech opened this issue Nov 26, 2019 · 11 comments
Assignees

Comments

@sebastianpech
Copy link

There's a function _error used in src/CosReader.jl that is undefined.

@sambitdash
Copy link
Owner

Can you upload the file where you observed this behavior? Although the fix may be easy, for a test case to be added we need to have the file.

@sebastianpech
Copy link
Author

No I can't, but I will check if I can extract the part thats causing the error

sambitdash added a commit that referenced this issue Nov 27, 2019
Fixes the issue #78
@sambitdash
Copy link
Owner

@sebastianpech I guess #80 should fix this. But, I will keep the issue open just so that you can provide us an isolated extracted file to add to the test case.

@sebastianpech
Copy link
Author

This is the error I get:

ERROR: Unexpected character at 263 found 100
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] _error(::String, ::Base.GenericIOBuffer{Array{UInt8,1}}) at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/CosReader.jl:6
 [3] parse_xstring(::Base.GenericIOBuffer{Array{UInt8,1}}) at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/CosReader.jl:201
 [4] parse_value(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Function) at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/CosReader.jl:28
 [5] parse_value at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/CosReader.jl:26 [inlined]
 [6] on_cmap_command!(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Symbol, ::Array{CosInt,1}, ::PDFIO.PD.CMap) at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/PDFonts.jl:349
 [7] read_cmap(::Base.GenericIOBuffer{Array{UInt8,1}}) at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/PDFonts.jl:384
 [8] get_unicode_mapping(::PDFIO.Cos.CosIndirectObject{CosStream}) at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/PDFonts.jl:153
 [9] get_unicode_mapping(::PDFIO.Cos.CosDocImpl, ::PDFIO.Cos.CosIndirectObject{CosDict}) at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/PDFonts.jl:143
 [10] Type at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/PDFonts.jl:411 [inlined]
 [11] get_pd_font!(::PDFIO.PD.PDDocImpl, ::PDFIO.Cos.CosIndirectObject{CosDict}) at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/PDDocImpl.jl:112
 [12] get_font(::PDFIO.PD.PDPageImpl, ::CosName) at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/PDPage.jl:311
 [13] evalContent!(::PDPageElement{:Tf}, ::PDFIO.PD.GState{:PDFIO}) at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/PDPageElement.jl:775
 [14] evalContent! at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/PDPageElement.jl:658 [inlined]
 [15] evalContent!(::PDPageTextObject, ::PDFIO.PD.GState{:PDFIO}) at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/PDPageElement.jl:720
 [16] evalContent! at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/PDPageElement.jl:658 [inlined]
 [17] pdPageEvalContent(::PDFIO.PD.PDPageImpl, ::PDFIO.PD.GState{:PDFIO}) at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/PDPage.jl:145
 [18] pdPageEvalContent at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/PDPage.jl:144 [inlined]
 [19] pdPageExtractText at /Users/sebastianpech/.julia/packages/PDFIO/Q0Nk3/src/PDPage.jl:178 [inlined]

Do you have any tipps for debugging that. My problem is that the error occurs in a pdf generated not on my device. After removing a page, undo to add it back and then save on my device the error vanishes.

@sebastianpech
Copy link
Author

Apparently it's a space (0x20) that's causing the problem

@sambitdash
Copy link
Owner

@sebastianpech the _error was a bug in the library which has been fixed.

For the specific error reported in your file now, I will have to review the file to comment. If you are ok, you can share the file with me over email as well. It will be hard to comment from the trace you sent. The issue seems to be in a font file embedded inside the PDF file.

@sambitdash
Copy link
Owner

sambitdash commented Nov 30, 2019

9ceafda may fix the issue as reported if I go by your comment on the space character.

@sebastianpech Please take the latest build and try out.

@sebastianpech
Copy link
Author

@sebastianpech the _error was a bug in the library which has been fixed.

Yeah I know. But I'm curious what's causing the error.

Sadly I really can't send you the file, it contains personal data from students and I can't get the data out as the moment I change something the error is gone.

9ceafda may fix the issue as reported if I go by your comment on the space character.

Currently building

@sebastianpech
Copy link
Author

That did the trick thanks.

I have another pdf which fails at this

@assert w > 0.1f0

assertation. Could that be related to objects being larger than the pagewidth?

@sambitdash
Copy link
Owner

I have another pdf which fails at this

@assert w > 0.1f0

assertation. Could that be related to objects being larger than the pagewidth?

Please file a separate bug on this.

@sambitdash
Copy link
Owner

That did the trick thanks.

Closing this bug based on the comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants