2016-04-19 6 views
0

Ich habe PDF Creator auf Umbraco 7.4 installiert. Wenn ich den Rasierer Beispiel Vorlage testen verwenden, kann ich eine PDF-Datei erstellen, aber wenn die PdfHelper Verwendung gibt esPdfHelper return Objektreferenz nicht auf Umbraco auf eine Instanz gesetzt 7.4

System.NullReferenceException: Object reference not set to an instance of an 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: } 

ich eine neue Vorlage erstellt haben:

<?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 this to force the browser to download the PDF. 
    // Response.AppendHeader("X-Pdf-Force-Download","darren.pdf"); 
} 
    @PdfHelper.Start() 

    @PdfHelper.MetaData(@CurrentPage.Name, "Darren Ferguson") 
    @PdfHelper.LayoutTwoColumnA4() 

    @* For ecnryption and password protection there is a: 
     PdfHelper.Secure() and 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() 

Und das gibt nur die oben genannten Fehler .

Die Protokolldatei enthält diese:

2016-04-19 08:42:41,711 [P16524/D23/T130] ERROR Umbraco.Core.UmbracoApplicationBase - An unhandled exception occurred 
System.NullReferenceException: Object reference not set to an instance of an object. 
    at ASP.PdfHelper.<Start>b__0(TextWriter __razor_helper_writer) in c:\Development\Projects\Support\Support\App_Code\PdfHelper.cshtml:line 5 
    at System.Web.WebPages.WebPageBase.Write(HelperResult result) 
    at ASP._Page_Views_PDF_cshtml.Execute() in c:\Development\Projects\Support\Support\Views\PDF.cshtml:line 12 
    at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() 
    at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() 
    at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) 
    at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) 
    at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) 
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) 
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) 
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) 
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) 
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) 
    at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) 
    at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) 
    at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) 
    at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) 
    at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) 
    at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) 
    at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) 
    at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) 
    at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) 
    at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) 
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 

Antwort

1

Problem behoben durch eine andere Vorlage mit

Verwandte Themen