Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dafydd Owen 33 posts 173 karma points
    Mar 12, 2014 @ 15:30
    Dafydd Owen
    0

    Linking to PDF Creator

    Hello,

    I have a working PDF generator using PDF Creator which is based on the default templates that are supplied with the package. 

    How can I create a link such as "generate pdf" and then begin the PDF download?

    I have tried using alttemplates which generates an XML document without a PDF download. 

    The alttemplate link is located inside the overview button in the footer and is called "Generate"
    http://champalimauddesign-demo.com.192-168-0-3.wests-server2.com/projects/hotels/fairmont.aspx

    Umbraco version 4.11.10 / Webforms.

    Thanks!

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Mar 12, 2014 @ 16:53
    Darren Ferguson
    0

    Normally when you get XML PDF creator isn't installed properly Either, adding the header that forces PDF generation, or the HTTP module that gets added to web.config during package installation.

    Can you check web.config for the PDF module, and if it is there, post the first 15/20 lines of your template?

     

    Thanks.

  • Dafydd Owen 33 posts 173 karma points
    Mar 12, 2014 @ 17:03
    Dafydd Owen
    0

    Hi,

    So in my web.config I can see this module; 
    <add name="PdfModule" type="FergusonMoriyama.Pdf.Application.Module.PdfModule, FergusonMoriyama.Pdf" />

    which is located inside  
    <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">

    and inside

    <httpModules>

    So that seems correct...?

    The start of generating template looks like this;

    <%@MasterLanguage="C#"MasterPageFile="~/masterpages/PDFMaster.master"AutoEventWireup="true" %>
    <asp:content ContentPlaceHolderId="PdfContentPlaceHolder"runat="server">
     
    <umbraco:Macro  runat="server"language="cshtml">
        @inherits umbraco.MacroEngines.DynamicNodeContext
        @using FergusonMoriyama.Pdf
        @using System.Xml
        @using umbraco.IO
        @{
          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");
        }

        

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Mar 12, 2014 @ 17:08
    Darren Ferguson
    0

    Puzzling - do you have a screengrab of the XML you get in the browser.

  • Dafydd Owen 33 posts 173 karma points
    Mar 12, 2014 @ 17:13
    Dafydd Owen
    0

    This the result I get when generating a PDF > Link removed

    This can be produced by clicking on the overview button in the footer and clicking on "Generate" in the in the overlay. 

    Thank you for your help.

     

     

  • Dafydd Owen 33 posts 173 karma points
    Mar 12, 2014 @ 17:45
    Dafydd Owen
    0

    Hi Darren,

    I have been testing the hello world example which works as expected. 
    I'm not sure what I changed in the initial example since I thought i'd only added a singe foreach loop. I must be mistaken...

    My original loop now works. 

    Thanks for your time and effort!

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Mar 13, 2014 @ 10:17
    Darren Ferguson
    0

    No worries! Good luck!

Please Sign in or register to post replies

Write your reply to:

Draft