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

save out pdf errors #10

Open
leluo opened this issue Mar 8, 2019 · 3 comments
Open

save out pdf errors #10

leluo opened this issue Mar 8, 2019 · 3 comments

Comments

@leluo
Copy link

leluo commented Mar 8, 2019

func (c *crawlResultFonts) parse(propVal *[]byte) error {
var props PDFObjPropertiesData
err := readProperties(propVal, &props)
if err != nil {
return err
}

for _, prop := range props {
	var crFont crawlResultFont
	fontIndex, err := strconv.Atoi(strings.TrimSpace(strings.Replace(prop.key, "F", "", -1)))
	//fontIndex, err := strconv.Atoi(strings.TrimSpace(strings.Replace(strings.Replace(prop.key, "C", "", -1), "_", "", -1)))
	if err != nil {
		fmt.Println(err.Error(), "strconv.Atoi fontIndex", prop.key)
		return err
	}
	objID, _, err := prop.asDictionary()
	if err != nil {
		return err
	}
	crFont.fontIndex = fontIndex
	crFont.fontObjID = objID
	*c = append(*c, crFont)
}
return nil

}

@leluo
Copy link
Author

leluo commented Mar 8, 2019

strconv.Atoi: parsing "C2_0": invalid syntax

oneplus1000 added a commit that referenced this issue Mar 10, 2019
fixed strconv.Atoi: parsing "C2_0": invalid syntax
but text still not show!!!
@aubelsb2
Copy link

aubelsb2 commented Jun 5, 2019

I am also geting this. Exact text can change, also getting:

2019/06/05 12:45:31 Couldn't save pdf.strconv.Atoi: parsing "TT5": invalid syntax

@Airthee
Copy link

Airthee commented Jan 23, 2022

Is there a fix in progress ?

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

3 participants