Fix TypeError: cannot unpack non-iterable PDFObjRef object, when unpacking the value of 'DW2' (#529)
Closes #518 * Fix TypeError: cannot unpack non-iterable PDFObjRef object, when unpacking the value of 'DW2' An error is occured when the 'DW2' key contains a PDFObjRef object instead of a list of int values, e.g: 'DW2': <PDFObjRef:152>. To solve this issue, we utilise the resolve1() function See: https://github.com/pdfminer/pdfminer.six/issues/518 * Updated CHANGELOG * Update CHANGELOG.md Co-authored-by: Dimitrios TSOLAKIDIS <dimitrios.tsolakidis@vialink.fr> Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>pull/484/head^2
parent
178a831802
commit
fc75972bbd
|
@ -5,11 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fix issue of TypeError: cannot unpack non-iterable PDFObjRef object, when unpacking the value of 'DW2' ([#529](https://github.com/pdfminer/pdfminer.six/pull/529))
|
||||||
|
|
||||||
## Removed
|
## Removed
|
||||||
- Support for Python 3.4 and 3.5 ([#522](https://github.com/pdfminer/pdfminer.six/pull/522))
|
- Support for Python 3.4 and 3.5 ([#522](https://github.com/pdfminer/pdfminer.six/pull/522))
|
||||||
- Unused dependency on `sortedcontainers` package ([#525](https://github.com/pdfminer/pdfminer.six/pull/525))
|
- Unused dependency on `sortedcontainers` package ([#525](https://github.com/pdfminer/pdfminer.six/pull/525))
|
||||||
|
|
||||||
|
|
||||||
## [20201018]
|
## [20201018]
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
|
@ -706,7 +706,7 @@ class PDFCIDFont(PDFFont):
|
||||||
widths = get_widths2(list_value(spec.get('W2', [])))
|
widths = get_widths2(list_value(spec.get('W2', [])))
|
||||||
self.disps = {cid: (vx, vy)
|
self.disps = {cid: (vx, vy)
|
||||||
for (cid, (_, (vx, vy))) in widths.items()}
|
for (cid, (_, (vx, vy))) in widths.items()}
|
||||||
(vy, w) = spec.get('DW2', [880, -1000])
|
(vy, w) = resolve1(spec.get('DW2', [880, -1000]))
|
||||||
self.default_disp = (None, vy)
|
self.default_disp = (None, vy)
|
||||||
widths = {cid: w for (cid, (w, _)) in widths.items()}
|
widths = {cid: w for (cid, (w, _)) in widths.items()}
|
||||||
default_width = w
|
default_width = w
|
||||||
|
|
Loading…
Reference in New Issue