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

crashes in makerl #1

Closed
GoogleCodeExporter opened this issue May 30, 2015 · 3 comments
Closed

crashes in makerl #1

GoogleCodeExporter opened this issue May 30, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Go to example/rl1/
2. run subset.py test.pdf 1 1
3.

What is the expected output? What do you see instead?
I expect it to run, instead I get an error:

~/svn/pdfrw/examples/rl1$ python subset.py side1.pdf 1 1
Traceback (most recent call last):
  File "subset.py", line 43, in <module>
    go(inpfn, firstpage, lastpage)
  File "subset.py", line 36, in go
    canvas.doForm(makerl(canvas, page))
  File "~/svn/pdfrw/pdfrw/toreportlab.py", line 138, in makerl
    rlobj = makerl_recurse(doc, pdfobj)
  File "~/svn/pdfrw/pdfrw/toreportlab.py", line 131, in makerl_recurse
    return func(rldoc, pdfobj)
  File "~/svn/pdfrw/pdfrw/toreportlab.py", line 94, in _makestream
    rldict[key[1:]] = makerl_recurse(rldoc, value)
  File "~/svn/pdfrw/pdfrw/toreportlab.py", line 131, in makerl_recurse
    return func(rldoc, pdfobj)
  File "~/svn/pdfrw/pdfrw/toreportlab.py", line 72, in _makedict
    rldict[key[1:]] = makerl_recurse(rldoc, value)
  File "~/svn/pdfrw/pdfrw/toreportlab.py", line 131, in makerl_recurse
    return func(rldoc, pdfobj)
  File "~/svn/pdfrw/pdfrw/toreportlab.py", line 72, in _makedict
    rldict[key[1:]] = makerl_recurse(rldoc, value)
  File "~/svn/pdfrw/pdfrw/toreportlab.py", line 131, in makerl_recurse
    return func(rldoc, pdfobj)
  File "~/svn/pdfrw/pdfrw/toreportlab.py", line 108, in _makearray
    mylist = rlobj.sequence
AttributeError: PDFObjectReference instance has no attribute 'sequence'

What version of the product are you using? On what operating system?
Subversion revision 82
On Linux.

Please provide any additional information below.
Don't know if this helps, but if I place a try/except around the sequence
usage like so:
    try:
        mylist = rlobj.sequence
        for value in pdfobj:   
            mylist.append(makerl_recurse(rldoc, value))
        print dir(rlobj)
    except:
        print dir(rlobj)

    return rlobj

I get the following output:
['__PDFObject__', '__doc__', '__init__', '__module__', 'format', 'name']
['__PDFObject__', '__doc__', '__init__', '__module__', 'format', 'name']
['__PDFObject__', '__doc__', '__init__', '__module__', 'format', 'name']
['References', '__PDFObject__', '__doc__', '__init__', '__module__',
'format', 'multiline', 'sequence']
['References', '__PDFObject__', '__doc__', '__init__', '__module__',
'format', 'multiline', 'sequence']
['References', '__PDFObject__', '__doc__', '__init__', '__module__',
'format', 'multiline', 'sequence']
['References', '__PDFObject__', '__doc__', '__init__', '__module__',
'format', 'multiline', 'sequence']

Ah, and it works.. (output file seems correct anyways) :)

Original issue reported on code.google.com by asan...@gmail.com on 12 Jan 2010 at 11:20

@GoogleCodeExporter
Copy link
Author

Indirect arrays were not being properly copied.  I think I fixed that bug in
subversion revision 83.  Please see if this fixes the problem on your PDF file, 
and
update the bug status appropriately.

Thanks!



Original comment by pmaupin on 12 Jan 2010 at 3:15

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Works for me! Thank you! :)

Original comment by asan...@gmail.com on 12 Jan 2010 at 4:04

@GoogleCodeExporter
Copy link
Author

Reported fixed by user.

Original comment by pmaupin on 12 Jan 2010 at 4:08

  • Changed state: Verified

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

1 participant