Hi there,
I am trying to create PDF exports of pages using the Java API of Confluence. I am using @ComponentImport PdfExporterService
This groovy code example works:
import com.atlassian.confluence.pages.Page
import com.atlassian.confluence.pages.PageManager
import com.atlassian.confluence.user.AuthenticatedUserThreadLocal
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.confluence.extra.flyingpdf.analytic.PageExportMetrics;
import com.atlassian.confluence.extra.flyingpdf.PdfExporterService
import com.atlassian.user.User
Page page = ComponentLocator.getComponent(PageManager.class).getAbstractPage(114915234)
User user = AuthenticatedUserThreadLocal.getUser()
return pdfExporterService.createPdfForPage(user, page, "", new PageExportMetrics())
(I am using an own groovy console which allows me to inject a binding to the PdfExporterService)
Doing similar in Java fails with
java.lang.ClassNotFoundException: com.atlassian.confluence.extra.flyingpdf.analytic.PageExportMetrics
I played around with the class loaders a little, but nothing seems to help. How can I make the class loader find that class?
Hey @swisscompedia how are you? Did you finally were able to solve this?
We are in the same situation. We tried to use the PdfExporterService and we got the same error because of the PageExportMetrics class not found.
Seems like they only exported first level classes of the package com.atlassian.confluence.extra.flyingpdf
But this is really weird as you cannot use this service without analytics classes.
The only service we could use is the XmlToPdfConverter. But we still got no successful results because some resources cannot be resolved (the contextPath parameter is best candidate to be wrong).
Did you opened a ticket to Atlassian for this? Maybe we should do it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Updates: They have created a bug ticket, so there is hope of incoming versions with a fix. Feel free to vote!! :pray:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.