You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to run the example code in examples/rl2 by invoking copy.py and it's raising an error in decodegraphics.py:
File "/home/dragon/dxw/pdfrw/examples/rl2/decodegraphics.py", line 362, in findparsefuncs
for key, func in globals().items():
RuntimeError: dictionary changed size during iteration
And sure enough, that's what's happening. The first time a key starts with "parse_", the next line sets some variables and increases the number of globals from 67 to 68.
Working out the items ahead of time seems to get past this problem (since the new ones probably aren't "parse_") --
items = [x for x in globals().items() if x[0].startswith('parse_')]
for key, func in list(items):
...
[WARNING] tokens.py:221 Did not find PDF object (33, 0) (line=620, col=1, token='endobj')
[WARNING] uncompress.py:46 Not decompressing: cannot use filter '/DCTDecode' with parameters None
Unparsed parameters/commands: ['/P', '<<', '/MCID', '0', '>>', 'BDC']
Traceback (most recent call last):
File "/home/dragon/dxw/pdfrw/py3k/lib/python3.6/site-packages/reportlab/pdfbase/pdfmetrics.py", line 714, in getFont
return _fonts[fontName]
KeyError: 'Arial'
During handling of the above exception, another exception occurred:
File "/home/dragon/dxw/pdfrw/py3k/lib/python3.6/site-packages/reportlab/pdfbase/pdfmetrics.py", line 655, in getTypeFace
return _typefaces[faceName]
KeyError: 'Arial'
Is this an old, out of date example or am I missing something? pdfrw.__version__ == '0.4'
The text was updated successfully, but these errors were encountered:
I'm trying to run the example code in examples/rl2 by invoking copy.py and it's raising an error in decodegraphics.py:
And sure enough, that's what's happening. The first time a key starts with "parse_", the next line sets some variables and increases the number of globals from 67 to 68.
Working out the items ahead of time seems to get past this problem (since the new ones probably aren't "parse_") --
I then get other errors but it's at least looking at the PDF file now (file is https://www.england.nhs.uk/commissioning/wp-content/uploads/sites/12/2013/11/N-SC023.pdf -- content is SFW but may raise eyebrows)
Is this an old, out of date example or am I missing something?
pdfrw.__version__ == '0.4'
The text was updated successfully, but these errors were encountered: