xml - PdfHelper return Object reference not set to an instance on Umbraco 7.4 -
i have installed pdf creator on umbraco 7.4. if test using razor example template, can create pdf when using pdfhelper returns
system.nullreferenceexception: object reference not set instance of object. line 3: @helper start() { line 4: <!-- start root --> line 5: @html.raw("<fo:root xmlns:fo=\"http://www.w3.org/1999/xsl/format\" xmlns:ibex=\"http://www.xmlpdf.com/2003/ibex/format\">") line 6: <!-- end root --> line 7: }
i have created new template:
<?xml version="1.0" encoding="utf-8" ?> @inherits umbraco.web.mvc.umbracotemplatepage @{ layout = null; //response.contenttype = "text/xsl"; //response.appendheader("x-pdf-render", "true"); // -- uncomment force browser download pdf. // response.appendheader("x-pdf-force-download","darren.pdf"); } @pdfhelper.start() @pdfhelper.metadata(@currentpage.name, "darren ferguson") @pdfhelper.layouttwocolumna4() @* ecnryption , password protection there a: pdfhelper.secure() , pdfhelper.secure("userpass", "ownerpass") helper *@ @pdfhelper.startbody() @pdfhelper.startarea("header") @pdfhelper.block(@currentpage.name, "arial", "23pt", "#3399ff") @pdfhelper.endarea() @pdfhelper.startarea("body") @pdf.renderrichtext(@currentpage.bodytext) @pdfhelper.pagerblock() @pdfhelper.endarea() @pdfhelper.endbody() @pdfhelper.end()
and returns above mentioned error.
the log file contains this:
2016-04-19 08:42:41,711 [p16524/d23/t130] error umbraco.core.umbracoapplicationbase - unhandled exception occurred system.nullreferenceexception: object reference not set instance of object. @ asp.pdfhelper.<start>b__0(textwriter __razor_helper_writer) in c:\development\projects\support\support\app_code\pdfhelper.cshtml:line 5 @ system.web.webpages.webpagebase.write(helperresult result) @ asp._page_views_pdf_cshtml.execute() in c:\development\projects\support\support\views\pdf.cshtml:line 12 @ system.web.webpages.webpagebase.executepagehierarchy() @ system.web.mvc.webviewpage.executepagehierarchy() @ system.web.webpages.webpagebase.executepagehierarchy(webpagecontext pagecontext, textwriter writer, webpagerenderingbase startpage) @ umbraco.core.profiling.profilingview.render(viewcontext viewcontext, textwriter writer) @ system.web.mvc.viewresultbase.executeresult(controllercontext context) @ system.web.mvc.controlleractioninvoker.invokeactionresultfilterrecursive(ilist`1 filters, int32 filterindex, resultexecutingcontext precontext, controllercontext controllercontext, actionresult actionresult) @ system.web.mvc.controlleractioninvoker.invokeactionresultfilterrecursive(ilist`1 filters, int32 filterindex, resultexecutingcontext precontext, controllercontext controllercontext, actionresult actionresult) @ system.web.mvc.controlleractioninvoker.invokeactionresultfilterrecursive(ilist`1 filters, int32 filterindex, resultexecutingcontext precontext, controllercontext controllercontext, actionresult actionresult) @ system.web.mvc.controlleractioninvoker.invokeactionresultfilterrecursive(ilist`1 filters, int32 filterindex, resultexecutingcontext precontext, controllercontext controllercontext, actionresult actionresult) @ system.web.mvc.controlleractioninvoker.invokeactionresultwithfilters(controllercontext controllercontext, ilist`1 filters, actionresult actionresult) @ system.web.mvc.async.asynccontrolleractioninvoker.<>c__displayclass21.<begininvokeaction>b__1e(iasyncresult asyncresult) @ system.web.mvc.async.asynccontrolleractioninvoker.endinvokeaction(iasyncresult asyncresult) @ system.web.mvc.controller.<beginexecutecore>b__1d(iasyncresult asyncresult, executecorestate innerstate) @ system.web.mvc.async.asyncresultwrapper.wrappedasyncvoid`1.callenddelegate(iasyncresult asyncresult) @ system.web.mvc.controller.endexecutecore(iasyncresult asyncresult) @ system.web.mvc.async.asyncresultwrapper.wrappedasyncvoid`1.callenddelegate(iasyncresult asyncresult) @ system.web.mvc.controller.endexecute(iasyncresult asyncresult) @ system.web.mvc.mvchandler.<beginprocessrequest>b__5(iasyncresult asyncresult, processrequeststate innerstate) @ system.web.mvc.async.asyncresultwrapper.wrappedasyncvoid`1.callenddelegate(iasyncresult asyncresult) @ system.web.mvc.mvchandler.endprocessrequest(iasyncresult asyncresult) @ system.web.httpapplication.callhandlerexecutionstep.system.web.httpapplication.iexecutionstep.execute() @ system.web.httpapplication.executestep(iexecutionstep step, boolean& completedsynchronously)
problem fixed using template
Comments
Post a Comment