Copied to clipboard

Flag this post as spam?

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


  • René 327 posts 852 karma points
    Jun 05, 2015 @ 21:58
    René
    0

    Render macro in macro - pdf-preview

    Hi 

    I´m stucked here.  Hope there are a briliant umbracian who can help :-)

    Umbraco v6.1.2 - Running webforms :-(

    I am trying to run the pdfprewiev trough a macro. https://our.umbraco.org/projects/pdf-preview

    it does not give any errors.

     

    Macroscript:

    @foreach (dynamic d in Model.productBrochure)
           
    {
           
    <div>    
            var id = d.File.id;                          
                   
    @Library.RenderMacro("PdfPreview", new { PageNum = 1, MediaId = id, QualityDPI = 18, LinkURL = mediaUrl})
             
    </div>
           
    }

     

    Output

     

    <div id="PdfThumbView_16__thumbPreview" class="ctr-pdfpreview">

    </div>

    ----------------------------------------------------------------------------


    When i try to run it as a macro in the template it works great PdfPriview.

     

    <umbraco:Macro PageNum="1" MediaId="1447" QualityDPI="" LinkURL="" Alias="PdfPreview" runat="server"></umbraco:Macro>    

     

    Output trom the "<umbraco:Macro" tag in the template : 

     

    <div id="ContentPlaceHolderDefault_ContentPlaceholderMaster_PdfThumbView_20__thumbPreview" class="ctr-pdfpreview">
       
    <a href="/media/3901/rammepresse_r20.pdf"><img src="/umbraco/plugins/pdfthumbnail.aspx?index=1&amp;path=%2fmedia%2f3901%2frammepresse_r20.pdf&amp;dpi=18&amp;borderwidth=1&amp;bordercolor=808080&amp;highquality=False&amp;defaultfont=" border="0"></a><!--
    Package Authors: Scandia Consulting (http://www.scandiaconsulting.com)
    PDF Core:
    http://tallcomponents.net/pdfthumbnail-versions.aspx

    -->

    </div>


    I need to have a list of pdf files output with thumbnails. The pdf files is chosen by the 
     Digibiz Advanced Media Picker

    I have got the id from the mediaItem in the xml to list the pdffiles.

    /René 

Please Sign in or register to post replies

Write your reply to:

Draft