PDF Viewer Macro (Pro)

Last modified by Administrator on 2020/09/20 00:00

PDF Viewer Macro (Pro)

This macro allows to view PDF files attached to XWiki page right inside the XWiki page.

Active Installs219
2 Votes
LicenseGNU Lesser General Public License 2.1
Minimal XWiki version supportedXWiki 8.4

The PDF Pro Viewer Macro allows users to load and view PDF files inside a wiki page. The Viewer supports a double full screen mode:

  • first going full screen in your browser
  • then going full screen on your computer if your browser supports that mode.

The PDF location could be the current wiki page, another wiki page or an external URL.





Below are described the parameters of the PDF Viewer Macro that need be used in order to define the way a PDF file is displayed in a wiki page.

NamePretty nameMandatory?DefaultDescription
asauthorDelegate my view rightcancel0If this value is true (or 1 or yes) and the viewing user has no access to the document containing the PDF file, the PDF file could still be viewed on behalf of your view right (as long as you have view right on the containing document obviously).
documentDocumentcancelcurrent documentReference to the XWiki document to which the file is attached (e.g. xwiki:Path.To.Document). The xwiki: part can be ignored if the file is located in the current wiki). If file argument is an absolute URL, this argument is ignored.
fileFileacceptN/AName or the absolute URL of the PDF file.
heightHeightcancel1000The viewer height, accepts values in pixels or in percentage.
widthWidthcancel100%The viewer width, accepts values in pixels or in percentage.

Using the macro from WYSIWYG editor

Edit a wiki page in WYSIWYG mode and look in the tool bar for the icon (XWiki Macro), search for PDF Viewer Macro and fill in the parameters values. 

Using the macro from wiki editor (code)

PDF file attached to a wiki page

To note that when using this option to display a PDF on a wiki page, the URL for the PDF will be generated using the XWiki API which can handle different setups for the wiki (path based, domain based, alias updates, etc).

{{pdfviewer file="gsoc.pdf" document="dev:GoogleSummerOfCode.WebHome" asauthor="1" height="900" width="80%"/}}

PDF file attached to a terminal wiki page

When having a PDF file attached to a terminal page, the syntax is slightly different, leaving out the "WebHome" mention.

{{pdfviewer file="gsoc.pdf" document="dev:GoogleSummerOfCode" asauthor="1" height="900" width="80%"/}}

PDF accessed from an external resource via URL

When using an absolut/explicit URL to display the PDF on a wiki page, keep in mind that you might need to update the URL if the alias of the source where the PDF is located will be changed. 

{{pdfviewer file="http://dev.xwiki.org/xwiki/bin/download/GoogleSummerOfCode/gsoc.pdf" /}}


Display multiple PDF files in the same page using a tab system layout

Add more PDF files, separated by comma.

{{pdfviewer file="TLSanalysis.pdf,H-MSD2018.pdf"/}}



Installation Steps

This paid extensions requires XWiki 8.4 or above. In order to install the extension, follow the next steps inside your XWiki instance (on cloud or on premise).

Navigate to the Extension Manager

In the Applications Panel click on "More Applications..." and then "Install new applications...". Alternatively navigate directly to the Administration and select the "Extensions" section.


Install the Extension

Search for the extension you wish to install and use the Install button to install it.


Get a License

Navigate to the "Licenses" section of the Administration, fill your details, look for the extension you just installed in the live table and click the buttons to get a trial license or to buy a license.


Install the License

If you have selected a trial license then you're good and there's nothing else to do. Your trial license is automatically installed.

However if you've selected to buy a license you'll be redirected to a page to perform the payment. At the end you need to come back to the "Licenses" administration section and click on the "Check for Updates" button. This will download and apply the license you bought.

Use the Extension

Start using the Extension! Refer to the extension's documentation to know how to use it.


The price is per year and varies depending on the support level and the number of users.

Support / Users 10 25 50 100 250 500 1000 2500 5000 10000 20000
PDF Viewer Macro (Pro) is part of the XWiki Pro package. Purchasing this package you will benefit from more extensions at a better price. Check the full offer in XWiki Pro!


What do you get when you purchase an XWiki extension?

1 year license

By purchasing an XWiki extension license, you'll benefit from it during one year.

Free updates

You benefit from all the extension updates during one year. You are always up to date.

Support included

If you are facing an issue, you can reach the XWiki support. Our team is always available to help.

How to Buy

To buy, install this extension from inside your XWiki instance and follow the instructions.

Release notes


#17 External PDFs are not displayed using credentials.


Bugs fixed:
#15 External PDFs are not displayed.

#10-1 Open the links inside the PDF documents in a new tab.
#10-2 Allow author of the macro to delegate its view right on the PDF document.
#16 Update PDF.js version from 2.1.266 to v2.5.207. Release notes: https://github.com/mozilla/pdf.js/releases/tag/v2.5.207
#13 Update XWiki parent version to 9.11


Update the Licensing dependency to version 1.14.4.


Update the Licensing dependency to version 1.14.3.


Bugs fixed:
#11 Some attachments don't work as expected anymore.


Update the PDF.js dependency from version 1.1.3 to version 2.1.266. Full list of changes on https://github.com/mozilla/pdf.js/releases.


Update the Licensing dependency to version 1.13.8.


Update the Licensing dependency to version 1.13.4.


Update the Licensing dependency to version 1.13.3.


Update the Licensing dependency to version 1.13.2.


#5 Display several PDF files using a tab system layout.


Update the Licensing dependency to version 1.13.


Update the Licensing dependency to version 1.12.2.


Update the Licensing dependency to version 1.12.1.


Improve the message displayed when there is no valid license.


Initial paid version.

Extension details

This information is only displayed to Administrators. Your users can't see this tab.


  • GNU Lesser General Public License 2.1




  • xar

Developed by


  • Requires XWiki 8.4 or above.
Installable with the Extension Manager


  • com.xwiki.licensing:application-licensing-licensor-api 1.16
Created by Administrator on 2018/02/26 13:15
XWiki SAS Copyright © 2019