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

Troubleshooting PDF Validate Error #737

Closed
sarahzc9 opened this issue Nov 22, 2023 · 9 comments
Closed

Troubleshooting PDF Validate Error #737

sarahzc9 opened this issue Nov 22, 2023 · 9 comments
Assignees

Comments

@sarahzc9
Copy link

OS: MacOS Sonoma 14.0

Hi there! Thanks for this wonderful library. Our project involves filling fillable PDFs using this package and I've run into an issue with one of the PDFs. It's giving the following error when I run pdfcpu validate:

validation error (obj#:864): pdfcpu: array element 0 not a number (Float/Integer

The package works wonderfully with the other PDFs, so I think it's a problem with this particular file, but I have no clue what it means or what array it's referring to in order to fix it. Any help would be greatly appreciated!

Also, I noticed that this error was posted in this issue from 2 years ago (error number 6 in #384 ), but I can't find the follow ups with any solutions, so if there is something that you can point me towards, that would also be greatly appreciated.

Thank you! ^^

@hhrutter
Copy link
Collaborator

Hello!

I need to see a stacktrace which you can produce like so: pdfcpu validate -vv your.pdf
Even better if you can share the file in question, so we can provide a fix.
You can also send me an email.

Thanks for using pdfcpu 💚

@sarahzc9
Copy link
Author

Hello again,

Thank you for the quick response! I pasted the stack trace below and attached the file in question. ^^
Order - Ontario General Test (Template) - Filable.pdf

Fatal: pdfcpu: array element 0 not a number (Float/Integer
github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types.Array.FloatNumber
	github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types/types.go:362
github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types.RectForArray
	github.com/pdfcpu/pdfcpu/pkg/pdfcpu/types/types.go:178
github.com/pdfcpu/pdfcpu/pkg/pdfcpu.Annotation
	github.com/pdfcpu/pdfcpu/pkg/pdfcpu/annotation.go:145
github.com/pdfcpu/pdfcpu/pkg/pdfcpu/validate.validatePageAnnotations
	github.com/pdfcpu/pdfcpu/pkg/pdfcpu/validate/annotation.go:1631
github.com/pdfcpu/pdfcpu/pkg/pdfcpu/validate.validatePagesAnnotations
	github.com/pdfcpu/pdfcpu/pkg/pdfcpu/validate/annotation.go:1699
github.com/pdfcpu/pdfcpu/pkg/pdfcpu/validate.validateRootObject
	github.com/pdfcpu/pdfcpu/pkg/pdfcpu/validate/xReftable.go:1015
github.com/pdfcpu/pdfcpu/pkg/pdfcpu/validate.XRefTable
	github.com/pdfcpu/pdfcpu/pkg/pdfcpu/validate/xReftable.go:41
github.com/pdfcpu/pdfcpu/pkg/api.ValidateContext
	github.com/pdfcpu/pdfcpu/pkg/api/api.go:80
github.com/pdfcpu/pdfcpu/pkg/api.Validate
	github.com/pdfcpu/pdfcpu/pkg/api/validate.go:55
github.com/pdfcpu/pdfcpu/pkg/api.ValidateFile
	github.com/pdfcpu/pdfcpu/pkg/api/validate.go:96
github.com/pdfcpu/pdfcpu/pkg/api.ValidateFiles
	github.com/pdfcpu/pdfcpu/pkg/api/validate.go:119
github.com/pdfcpu/pdfcpu/pkg/cli.Validate
	github.com/pdfcpu/pdfcpu/pkg/cli/cli.go:32
github.com/pdfcpu/pdfcpu/pkg/cli.Process
	github.com/pdfcpu/pdfcpu/pkg/cli/process.go:35
main.process
	github.com/pdfcpu/pdfcpu/cmd/pdfcpu/process.go:136
main.processValidateCommand
	github.com/pdfcpu/pdfcpu/cmd/pdfcpu/process.go:193
main.commandMap.process
	github.com/pdfcpu/pdfcpu/cmd/pdfcpu/cmd.go:143
main.main
	github.com/pdfcpu/pdfcpu/cmd/pdfcpu/main.go:56
runtime.main
	runtime/proc.go:267
runtime.goexit
	runtime/asm_amd64.s:1650
validation error (obj#:864)
github.com/pdfcpu/pdfcpu/pkg/api.Validate
	github.com/pdfcpu/pdfcpu/pkg/api/validate.go:60
github.com/pdfcpu/pdfcpu/pkg/api.ValidateFile
	github.com/pdfcpu/pdfcpu/pkg/api/validate.go:96
github.com/pdfcpu/pdfcpu/pkg/api.ValidateFiles
	github.com/pdfcpu/pdfcpu/pkg/api/validate.go:119
github.com/pdfcpu/pdfcpu/pkg/cli.Validate
	github.com/pdfcpu/pdfcpu/pkg/cli/cli.go:32
github.com/pdfcpu/pdfcpu/pkg/cli.Process
	github.com/pdfcpu/pdfcpu/pkg/cli/process.go:35
main.process
	github.com/pdfcpu/pdfcpu/cmd/pdfcpu/process.go:136
main.processValidateCommand
	github.com/pdfcpu/pdfcpu/cmd/pdfcpu/process.go:193
main.commandMap.process
	github.com/pdfcpu/pdfcpu/cmd/pdfcpu/cmd.go:143
main.main
	github.com/pdfcpu/pdfcpu/cmd/pdfcpu/main.go:56
runtime.main
	runtime/proc.go:267
runtime.goexit
	runtime/asm_amd64.s:1650

@hhrutter
Copy link
Collaborator

This will be fixed in the upcoming release.

@sarahzc9
Copy link
Author

thank you! may i ask what the issue was? :O

@hhrutter
Copy link
Collaborator

A bug, where pdfcpu was assuming numeric values for a rectangle.
The reality is the PDF spec also allows for indirect objects within rectangles.

@sarahzc9
Copy link
Author

Ah I see! Thank you for letting me know. ^^ Not to rush you at all, but I was also wondering if you had a date planned for the next release? If not it's no biggie!

@hhrutter
Copy link
Collaborator

Over the next couple of days.. I do what I can..

@sarahzc9
Copy link
Author

Ok, thank you! Again, no rush at all! Was just asking to coordinate with a teammate is all. Thank you for your work ^^

@hhrutter
Copy link
Collaborator

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

No branches or pull requests

2 participants