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

cli: command "form list" does not extract combobox values #770

Closed
sbourlon opened this issue Jan 10, 2024 · 2 comments
Closed

cli: command "form list" does not extract combobox values #770

sbourlon opened this issue Jan 10, 2024 · 2 comments
Assignees

Comments

@sbourlon
Copy link

  • Your issue is based on the latest commit

v0.6.0 dev

$ pdfcpu version
pdfcpu: v0.6.0 dev
panic: runtime error: slice bounds out of range [:8] with length 1

goroutine 1 [running]:
main.printVersion(0xc0001e1110)
        /home/stefan/Local/Go/pkg/mod/github.com/pdfcpu/pdfcpu@v0.6.0/cmd/pdfcpu/process.go:143 +0x24b
main.commandMap.process(0x44113c?, {0x7fff0e661735, 0x7}, {0x0, 0x0})
        /home/stefan/Local/Go/pkg/mod/github.com/pdfcpu/pdfcpu@v0.6.0/cmd/pdfcpu/cmd.go:143 +0x335
main.main()
        /home/stefan/Local/Go/pkg/mod/github.com/pdfcpu/pdfcpu@v0.6.0/cmd/pdfcpu/main.go:56 +0xa6
stefan@stefan-sb [03:47:52 PM] [~/tmp/cor/pdf]
  • State your OS and OS version
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 23.10
Release:        23.10
Codename:       mantiUbuntu 23.10c
  • Bug

Hello Horst, the bug is with the command pdfcpu form list

$ pdfcpu form list t2short-fill-19e.orig2.pdf  | grep -i combo
     ComboBox  │ 349.353.385.437.302     │ form1[0].Page3[0].Head_office[0].Line_016[0].Input_016[0]                            │         │       │ ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
     ComboBox  │ 349.353.386.429.293     │ form1[0].Page3[0].Mailing_address[0].Line_026[0].Input_026[0]                        │         │       │ ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
     ComboBox  │ 349.353.387.420.285     │ form1[0].Page3[0].Location_books[0].Line_036[0].Input_036[0]                         │         │       │ ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

The value of the three combo box (page 3) are not reported by pdfcpu when using the PDF https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/t2short/t2short-fill-19e.pdf, neither the combox box options.

 $ pdfcpu info ~/Downloads/t2short-fill-19e.pdf
/home/stefan/Downloads/t2short-fill-19e.pdf:
              Source: /home/stefan/Downloads/t2short-fill-19e.pdf
         PDF version: 1.7
          Page count: 4
           Page size: 612.00 x 792.00 points
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
               Title: T2 Short Return (2019 and later tax years)
              Author:
             Subject:
        PDF Producer: Designer 6.3
     Content creator: Designer 6.3
       Creation date: D:20191212115624-05'00'
   Modification date: D:20200108145629-05'00'
        Viewer Prefs: DisplayDocTitle = true
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
              Tagged: Yes
              Hybrid: No
          Linearized: No
  Using XRef streams: Yes
Using object streams: Yes
         Watermarked: No
          Thumbnails: No
                Form: Yes
     SignaturesExist: Yes
          AppendOnly: Yes
            Outlines: No
               Names: Yes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
           Encrypted: Yes
         Permissions:
permission bits: 101100110100 (xB34)
Bit  3: true (print(rev2), print quality(rev>=3))
Bit  4: false (modify other than controlled by bits 6,9,11)
Bit  5: true (extract(rev2), extract other than controlled by bit 10(rev>=3))
Bit  6: true (add or modify annotations)
Bit  9: true (fill in form fields(rev>=3)
Bit 10: true (extract(rev>=3))
Bit 11: false (modify(rev>=3))
Bit 12: true (print high-level(rev>=3))

However, using the provided example english.pdf from pdfcpu website, the values are properly extracted.

Do you have any guidance to debug this issue? I would be happy to contribute with a fix.

@hhrutter
Copy link
Collaborator

Thanks for reporting this!

hhrutter added a commit that referenced this issue Feb 6, 2024
@hhrutter
Copy link
Collaborator

hhrutter commented Feb 6, 2024

This is fixed with the latest commit!

@hhrutter hhrutter closed this as completed Feb 6, 2024
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