PdfDisplay

pdfDisplay macro

  • inline
    • no
  • content
    • none
  • parameters
    •  filename — the name of the attached PDF file to show
      • mandatory
    •  document — the page the PDF is attached to
      • default: the current page
    •  width — CSS width of the viewer
      • default: 600px 
    •  height — CSS height of the viewer
      • default: 600px 

The pdf macro of the PDF Macro extension reads only the page it is used on, so it cannot show a file that lives elsewhere — as the restricted renditions do, kept on a separate page that is not public. This macro takes that page as a parameter and renders the same three things: the full screen link, the viewer, and a download link for a browser that cannot display a PDF.

Examples

The examples read demo.pdf, a one-page document attached to this page for the purpose.

{{pdfDisplay filename="demo.pdf" height="300px"/}}


View this PDF full screen

You do not have the plugin required to display this PDF file. You can still download it: demo.pdf

{{pdfDisplay document="Macros.Presentation.PdfDisplay" filename="demo.pdf" width="60%" height="300px"/}}


View this PDF full screen

You do not have the plugin required to display this PDF file. You can still download it: demo.pdf

Counterexamples

{{pdfDisplay filename="nosuch.pdf"/}}


Errorno such attachment: nosuch.pdf

{{pdfDisplay document="Publication.NoSuchPage" filename="demo.pdf"/}}


Errorno such attachment: demo.pdf