PDF Attachment is not viewed / attachment is not found

I am a newbie at XWiki and installed Version 13.3 the last days.
I want to view a attached PDF file in a wiki page in a simple way. The macro used is the preinstalled PDFViewer macro.
Here is my used Sourcecode:
Example 1: {{pdfviewer file=“DocExample.pdf”/}}
Example 2: {{pdfviewer file=“http://xyz.com/xwiki/bin/download/Sandbox/TestPage1/DocExample.pdf?rev=1.1”/}}

No PDF file is viewed, the view area show an error “this attachment does not exist”
neither the relative nor the absolute file is shown.

How has the file location to be specified?

Regards Rainer


The file parameter can either be the name of a file attached to a document, or the url of a pdf.

{{pdfviewer file="mydoc.pdf"/}}

{{pdfviewer file="http://github.com/Hopding/pdf-lib/raw/master/pdf_specification.pdf"/}}

You can also use a pdf in attachment in another document by using the document parameter:

{{pdfviewer file="mydoc.pdf" document="xwiki:Sandbox.WebHome"/}}

In case of configuration error, you should obtain the results presented in the screenshot below:

  1. for the first block, when the document is not found in the attachments (and in this case check if the specified name matches the name of an attachment of the current document).
  2. for the second block, when the url does not point to a pdf


Hope that helps.

PS: Afaik pdf viewer is not preinstalled with XWiki in the standard distribution.

I got the problem :wink:
your hint, that the pdf viewer is not preinstalled was the important information
I first installed the PDF Viewer (pro), but I did not have a license key. So I deinstalled this extension.
After that a macro with the name “pdfviewer”, was already existing and selectable, but as described was not working.
I noticed, that the PDF Viewer 1.6.3 macro extension was not installed. After Installation all works fine.

Thanks for the right hint
Regards Rainer

1 Like