monster.ui.renderPDF()

Syntax

monster.ui.renderPDF(file, target[, options]);

Parameters

KeyDescriptionTypeDefaultRequired
fileFile received by a fileUpload plugin.Filetrue
targetTarget in which the iframe containing the PDF will be added.jQuerytrue
optionsObject(#/options)false

options

KeyDescriptionTypeDefaultRequired
widthWidth of the iframe.String100%false
heightHeight of the iframe.String700pxfalse

Description

This helper will take a file and show it in a container, in a PDF viewer

Example

Preview an uploaded file

template
  .find('#upload')
    .fileUpload({
      inputOnly: true,
      wrapperClass: 'file-upload input-append',
      btnClass: 'monster-button',
      success: function(results) {
        monster.ui.renderPDF(results[0].file, template.find('.pdf-container'));
      }
    });