Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/reportlab/pdfbase/rl_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,10 @@ def _makeCodecInfo(name,encoding_map,decoding_map):
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict',charmap_encode=codecs.charmap_encode,encoding_map=encoding_map):
return charmap_encode(input,errors,encoding_map)
try:
return charmap_encode(input,errors,encoding_map)
except Exception as e:
return (input.encode('utf-8'),len(input))

def decode(self,input,errors='strict',charmap_decode=codecs.charmap_decode,decoding_map=decoding_map):
return charmap_decode(input,errors,decoding_map)
Expand Down
4 changes: 4 additions & 0 deletions src/reportlab/pdfgen/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ class ExtGState:
OP=False,
op=False,
OPM=0,
BM='/Normal',
)

def __init__(self):
Expand Down Expand Up @@ -588,6 +589,9 @@ def _getCmShift(self):
if bleedW:
bw -= bleedW
return bw

def setBlendMode(self, v):
self._extgstate.set(self,'BM',v)

def showPage(self):
"""Close the current page and possibly start on a new page."""
Expand Down