PDF Export URL problem (Bug?)

Hi all,

In using a myxwiki.org site, I noticed what I believe is a change in behavior, and I suspect it may be a bug. It is, at least, something that isn’t working for me currently.

In the past, when we’d click the three-dot menu and export to PDF, we’d get a URL like this:
https://subwiki.myxwiki.org/xwiki/bin/export/pageTree1/PageName/WebHome?format=pdf&pdfcover=0&pdftoc=0&pdfheader=0&pdffooter=0&comments=0&attachments=0

That worked, and still works quite well.

Now, however, when we click on PDF export, this is the URL that gets generated (and never returns a response):
https://subwiki.myxwiki.org/xwiki/bin/export/pageTree1/PageName/?format=html-print&xpage=get&outputSyntax=plain&async=true&sheet=XWiki.PDFExport.Sheet&format=pdf&template=XWiki.PDFExport.Template&pdfcover=0&pdftoc=0&pdfheader=0&pdffooter=0&comments=0&attachments=0

I’ve made the above URLs more generic; if it helps, here’s an actual URL:
https://lhhspitpops.myxwiki.org/xwiki/bin/export/Contests/Lone%20Star%20Classic%20Drumline/?format=html-print&xpage=get&outputSyntax=plain&async=true&sheet=XWiki.PDFExport.Sheet&format=pdf&template=XWiki.PDFExport.Template&pdfcover=0&pdftoc=0&pdfheader=0&pdffooter=0&comments=0&attachments=0

Is this an expected URL change? If so, is there something we need to do in configuring the wiki to make it work?

Thanks much! -Lane

I did see that the PDF Export application needed to be upgraded, which I did. That doesn’t change the behavior. Browser network logs show the following:

jquery.min.js?r=1:2 GET https://lhhspitpops.myxwiki.org/xwiki/bin/export/Venues/Coppel%20Buddy%20Ec…late&pdfcover=0&pdftoc=0&pdfheader=0&pdffooter=0&comments=0&attachments=0& 403

(anonymous) @ jquery.min.js?r=1:2
He @ jquery.min.js?r=1:2
append @ jquery.min.js?r=1:2
S.fn. @ jquery.min.js?r=1:2
(anonymous) @ WebHome?minify=false…&docVersion=2.1:128
n @ WebHome?minify=false…n&docVersion=2.1:98
(anonymous) @ WebHome?minify=false…&docVersion=2.1:140
dispatch @ jquery.min.js?r=1:2
v.handle @ jquery.min.js?r=1:2

WebHome?minify=false…&docVersion=2.1:106 Uncaught TypeError: h[0].contentWindow.require is not a function at HTMLIFrameElement. (WebHome?minify=false…cVersion=2.1:106:33) at HTMLIFrameElement.dispatch (jquery.min.js?r=1:2:43064) at v.handle (jquery.min.js?r=1:2:41048)

(anonymous) @ WebHome?minify=false…&docVersion=2.1:106
dispatch @ jquery.min.js?r=1:2
v.handle @ jquery.min.js?r=1:2
load (async)
add @ jquery.min.js?r=1:2
s.event.add @ jquery-migrate.min.js?r=1:2
(anonymous) @ jquery.min.js?r=1:2
each @ jquery.min.js?r=1:2
each @ jquery.min.js?r=1:2
Ee @ jquery.min.js?r=1:2
on @ jquery.min.js?r=1:2
(anonymous) @ WebHome?minify=false…&docVersion=2.1:105
n @ WebHome?minify=false…n&docVersion=2.1:98
(anonymous) @ WebHome?minify=false…&docVersion=2.1:140
dispatch @ jquery.min.js?r=1:2
v.handle @ jquery.min.js?r=1:2

Hi,

So the fact that the URL changed might be expected since we worked on the new PDF Export Application as you have noticed. It’s more likely related to it. @mflorea would know more on this.
Now you shouldn’t have anything to do for it to be working, so it’s sounds like you’re experiencing some kind of regression that is definitely not expected. Could you open a ticket for it on https://jira.xwiki.org?

Done. [XWIKI-20076] PDF export spinning in MyXwiki.org - XWiki.org JIRA

Thanks much! -L

You didn’t upgrade the PDF Export Application because it can’t be upgraded from your subwiki:

Extension [org.xwiki.platform:xwiki-platform-export-pdf-default/14.6] is not allowed on namespace [wiki:lhhspitpops]. Allowed namespaces are: [{root}]

So ATM you have PDF Export Application 14.4 running on XWiki 14.6 (available myxwiki.org) and they are not compatible. You need PDF Export Application 14.6 but you can’t upgrade because between 14.4 and 14.6 we added a module (support for Docker-based export) that needs to be installed on root and this cannot be done from a subwiki. It has to be done from the main wiki. But installing on the main wiki means that all the users (all subwikis) will get the new client-side PDF export (instead of the old FOP-based PDF export) which is not right because it’s still experimental.

If you don’t need client-side PDF generation then you should simply uninstall the PDF Export Application and use the old PDF export.

If you need the client-side PDF generation, because your pages has dynamic content added through JavaScript, then there’s no easy solution ATM because first we need to fix XWIKI-19917 (so that we don’t rely on Docker by default, otherwise we need to setup Docker on myxwiki.org, and so that you can enable / disable the new PDF export by wiki, ATM it’s only for the entire XWiki instance).

Ah, that’s good info; thanks for the clarification. We’ve removed that application, and we’ll watch for changes on those tickets.

Note that this is done actually.

If that is the case then we could install org.xwiki.platform:xwiki-platform-export-pdf-default/14.6 on root from the main wiki. This won’t enable the new PDF export for all subwikis, but it will allow a subwiki admin to install (or upgrade) the UI for the new PDF export. But still, the config will be for the entire instance for now.