/** * Registers a Do handler that will be called when Do for the provided XObject subtype is encountered during content processing. * <br> * If you register a handler, it is a very good idea to pass the call on to the existing registered handler (returned by this call), otherwise you * may inadvertently change the internal behavior of the processor. * @param xobjectSubType the XObject subtype this handler will process, or PdfName.DEFAULT for a catch-all handler * @param handler the handler that will receive notification when the Do oper for the specified subtype is encountered * @return the existing registered handler, if any * @since 5.0.1 */ public IXObjectDoHandler RegisterXObjectDoHandler(PdfName xobjectSubType, IXObjectDoHandler handler) { IXObjectDoHandler old; xobjectDoHandlers.TryGetValue(xobjectSubType, out old); xobjectDoHandlers[xobjectSubType] = handler; return(old); }
/** * Registers a Do handler that will be called when Do for the provided XObject subtype is encountered during content processing. * <br> * If you register a handler, it is a very good idea to pass the call on to the existing registered handler (returned by this call), otherwise you * may inadvertently change the internal behavior of the processor. * @param xobjectSubType the XObject subtype this handler will process, or PdfName.DEFAULT for a catch-all handler * @param handler the handler that will receive notification when the Do oper for the specified subtype is encountered * @return the existing registered handler, if any * @since 5.0.1 */ public IXObjectDoHandler RegisterXObjectDoHandler(PdfName xobjectSubType, IXObjectDoHandler handler){ IXObjectDoHandler old; xobjectDoHandlers.TryGetValue(xobjectSubType, out old); xobjectDoHandlers[xobjectSubType] = handler; return old; }
public override IXObjectDoHandler RegisterXObjectDoHandler(PdfName xobjectSubType, IXObjectDoHandler handler) { var wrapper = new XObjectDoHandlerWrapper { OriginalHandler = handler }; var former = base.RegisterXObjectDoHandler(xobjectSubType, wrapper); return(former is XObjectDoHandlerWrapper formerWrapper ? formerWrapper.OriginalHandler : former); }