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
Is this a bug or is there a reason this not possible? If you simply call the same code on the whole document image instead with draw.draw(image), it draws the rectangle on the last page, which is also odd behavior.
Why not? The current wand.drawing.Drawing.draw method validates for an instances of wand.image.Image, but there's no reason to validated for wand.image.BaseImage instead. (but I might be wrong)
Workaround
Create a new instance of wand.image.Image from sequence slice.
Extend wand.drawing.Drawing.draw to validate against BaseImage. Untested
fromwand.drawingimportDrawingfromwand.imageimportBaseImageclassMyDrawing(Drawing):
defdraw(self, image):
ifnotisinstance(image, BaseImage):
raiseTypeError('image must be a wand.image.BaseImage instance, not '+repr(image))
res=library.MagickDrawImage(image.wand, self.resource)
ifnotres:
self.raise_exception()
I have a multi-page PDF on which I want to draw some annotation, however, when I try to call
draw.draw(singleimage)
Wand throws an error:Here is my sample code:
Is this a bug or is there a reason this not possible? If you simply call the same code on the whole document image instead with
draw.draw(image)
, it draws the rectangle on the last page, which is also odd behavior.PDF is attached.
Acme.pdf
The text was updated successfully, but these errors were encountered: