Problems using PDFPlugin#

If you're having problems using PDFPlugin, here are some problems that have shown up in the past along with some help. Have a look here for a solution to your problem. If it's not here, don't hesitate to contact me for assistance and if you find a bug, make sure to register it in the bug tracker at

Resolved problems#

Extended language support#

PDF plugin works fine in my personal web site. But it seems doesn't support Chinese characters. Any solutions? -- 2006-04-19

It doesn't support Greek characters neither. Does anyone have a solution for this?

--xarisd, 2006-08-01

Fixed in version 2.2. --PålBrattberg

Sample PDF#

What I really miss here is a sample PDF file or a public Wiki where it is installed, so I can test it. --Steff, 04-Apr-2006

Available now! See --PålBrattberg

I was having the following exceptiong when using PDFView in a Tomcat 5.5.11, JSPWiki v2.2.33, Brushed template:

javax.servlet.ServletException: Could not compile stylesheet

root cause

javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet Source) Source)

Looking in the logs, I found this:

Tidy (vers 4th August 2000) Parsing "InputStream"

InputStream: Document content looks like HTML 4.01 Transitional
no warnings or errors were found

[ERROR] Logger not set
	at gnu.xml.aelfred2.SAXDriver.getLineNumber(
	at Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at se.eminds.jspwiki.Wiki2PDFServlet.createPDF(

I was able to work around the problem by copying the XML libraries that come with FOP to the /WEB-INF/lib directory and using the XML parser configuration tip for Resin containers from the PDF Plugin page.
-- NascifAbousalhNeto

I got the following error from a user through email, and thought I'd replicate it here for others:

Hi Pal, I tried to configure your PDF Plugin, but it doesn't work :-(

I followed your instructions on the JSPWiki Page. I see the "View PDF" links on the pages, but when I restart the tomcat service, it always ends up in an error message like:

HTTP Status 500

javax.servlet.ServletException: Error instantiating servlet class se.eminds.jspwiki.Wiki2PDFServlet
	at org.apache.catalina.core.StandardWrapper.loadServlet(
	at org.apache.catalina.core.StandardWrapper.allocate(
	at org.apache.catalina.core.StandardWrapperValve.invoke(
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(

root cause

java.lang.NoClassDefFoundError: org/apache/log4j/Logger
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(
	at java.lang.Class.getConstructor0(
	at java.lang.Class.newInstance0(
	at java.lang.Class.newInstance(
	at org.apache.catalina.core.StandardWrapper.loadServlet(

The second click on such a links shows me a HTTP 503 error message:

HTTP Status 503 - Servlet Wiki2PDFServlet is currently unavailable

type Status report

message Servlet Wiki2PDFServlet is currently unavailable

description The requested service (Servlet Wiki2PDFServlet is currently unavailable) is not currently available.
Apache Tomcat/4.1.31
My response: This is caused by the fact that Tomcat's classloader cannot find a recent enough library of Log4J. You probably don't have it installed.
You can check this is Fedora by running:
$ locate tomcat | grep common/lib | grep log
If this doesn't return anything named log4j.jar or the like (perhaps only commons-logging-api.jar), you need to install log4j.
You find Log4J at
Download, unpack and copy the jar-file to the common/lib directory under your Tomcat root. Restart Tomcat and try again.

The email went on to state: When tomcat is starting up, I see the following:

INFO: Initializing Coyote HTTP/1.1 on http-8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.31
09.08.2005 22:41:15 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
09.08.2005 22:41:15 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
09.08.2005 22:41:16 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true
09.08.2005 22:41:22 org.apache.commons.digester.Digester error
SCHWERWIEGEND: Parse Error at line 162 column 11: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
org.xml.sax.SAXParseException: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
        at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(
        at org.apache.catalina.startup.ContextConfig.applicationConfig(
        at org.apache.catalina.startup.ContextConfig.start(
My response: If this comes even after you have tried the above (and you don't get java.lang.NoClassDefFoundError), could you send me a copy of your web.xml file? --PålBrattberg

Well, I have tried to use this without success. It seemed a valuable addition to the JSPWiki so I gave it a try. Unfortunately, I received the following stack trace:

   java.lang.IllegalAccessError: tried to access field org.w3c.tidy.ParserImpl._parseHead from class org.w3c.tidy.ParserImpl$ParseHTML

-- RichardStephan

Seems this was a known error with jTidy ( and is fixed in recent versions (r8+). You might wanna grab a nightly at
If you have more problems, email me at pal at for help!

-- PålBrattberg

Installation problems in Resin#

If you are using Resin you may see the following in your logs:
2005-04-13 17:06:56,048 [thread-pool-9] ERROR se.eminds.jspwiki.Wiki2PDFServlet InfosysWiki-v1:PDF - Throwable caught while trying to generate PDF.
com.caucho.xpath.XPathParseException: expected binary operation at `table' in ancestor:: table[1]/@rules = 'groups'
 at com.caucho.xpath.XPathParser.error(
 at com.caucho.xpath.XPathParser.scanToken(
 at com.caucho.xpath.XPathParser.parseExpr(
 at com.caucho.xpath.XPath.parseExpr(
 at com.caucho.xsl.JavaGenerator.createChild(
 at com.caucho.xsl.JavaGenerator.createChild(
 at com.caucho.xsl.JavaGenerator.createChild(
 at com.caucho.xsl.Generator.generateStylesheet(
 at com.caucho.xsl.Generator.generate(
 at com.caucho.xsl.AbstractStylesheetFactory.generate(
 at com.caucho.xsl.AbstractStylesheetFactory.generateFromNode(
 at com.caucho.xsl.AbstractStylesheetFactory.newTemplates(
 at com.caucho.xsl.AbstractStylesheetFactory.newTransformer(
 at se.eminds.jspwiki.Wiki2PDFServlet.createPDF(
 at se.eminds.jspwiki.Wiki2PDFServlet.doGet(
 at javax.servlet.http.HttpServlet.service(
 at javax.servlet.http.HttpServlet.service(
 at com.caucho.server.dispatch.ServletFilterChain.doFilter(
 at com.caucho.server.webapp.WebAppFilterChain.doFilter(
 at com.caucho.server.dispatch.ServletInvocation.service(
 at com.caucho.server.http.HttpRequest.handleRequest(
 at com.caucho.server.port.TcpConnection. run(
 at com.caucho.util.ThreadPool. runTasks(
 at com.caucho.util.ThreadPool. run(
 at java.lang.Thread. run(

What you could try is to use the Xalan XSLT processor from Apache. To do this, download Xalan from and then tell Resin to use Xalan instead of it's own XSLT processor (this can be applied to only jspwiki, no need to change for other applications running on this server). The jar should be placed in WEB-INF/lib.

Set the following in the web.xml file in jspwiki:

   <system-property javax.xml.transform.TransformerFactory="org.apache.xalan.processor.TransformerFactoryImpl"/>

See for more information.

03/13/2006 - PDFPlugin doesn't like page names that are not in CamelCase. I tried to create a PDF version of a page called "PrivateJRE" and got a corrupted PDF file. I looked inside and found this:

<html><head><title>Apache Tomcat/5.5.11 - Error report</title>
<style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;} {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>java.lang.IllegalArgumentException: 
You must supply a valid value for parameter &quot;page&quot;.

</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available
in the Apache Tomcat/5.5.11 logs.</u></p><HR size="1"
noshade="noshade"><h3>Apache Tomcat/5.5.11</h3></body></html>

When I changed the page name to "PrivateJreMeeting" it worked fine.

I am facing an issue when using the PDF plugin. The PDF file is getting generated. When i open that PDF file, the links are not working. Instead of opening up a new webpage, it is showing,the document is trying to connect to the site file:///EngWiki/Wiki.jsp?page=?Definiton. The link should be rendered as http://myip:8080/EngWiki/Wiki.jsp?page=?Definiton. Instead when i am saving it as a local copy it is coming as file:///EngWiki/Wiki.jsp?page=?Definiton. How can I rectify this?

--paddy, 21-Sep-2007

Fixed in version 2.2. --PålBrattberg

Unique Exception#

I receive the folowing exception:

javax.xml.transform.TransformerException: Property id "section-Java_Controls-RoadMap" previously used; id values must be unique in document.

reason: in the wikipage there are more than one header called !RoadMap is it possible to fix this problem?
--OlafKaus (14. Dec. 2007)

NullPointerException problems#

When I go to http://ip:8080/JSPWiki/wiki.pdf?page=System&ext=.pdf, I get:

Oct 23, 2007 9:53:45 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Wiki2PDFServlet threw exception
        at com.ecyrd.jspwiki.WikiEngine.getHTML(
        at com.ecyrd.jspwiki.WikiEngine.getHTML(
        at com.ecyrd.jspwiki.WikiEngine.getHTML(
        at com.palbrattberg.jspwiki.Wiki2PDFServlet.doGet(
        at javax.servlet.http.HttpServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(Unknown Source)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
        at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
        at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
        at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
        at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
        at org.apache.catalina.connector.CoyoteAdapter.service(Unknown Source)
        at org.apache.coyote.http11.Http11Processor.process(Unknown Source)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Unknown Source)
        at$ Source)

You cannot create PDF's from system pages, only regular pages. If you'd like this to work, please report it as a RFE (Request for Enhancement) on the tracker. --PålBrattberg

No images problem#

Hiya, very nice plugin but i also cant see images. I am running JSPWiki v2.4.102 on HPUX under apache-tomcat-6.0.13. I installed off your latest jspwiki2pdf-jar-with-dependencies-2.1.jar and made the 2 changes to the web.xml

My page looks fine except there are no images, it just goes onto the next thing, not even leaving the correct space.

thank you for your help

- louiszezeran 4-july-2007

Actually i fixed my own problem. I had the BASE url wrong and then I set page links to "absolute" and it all worked out. I checked out the log4j output and it said it had a wrong URL for the images which put me onto this one. A great plugin, thank you!

- louiszezeran 5-july-2007

How can I get the source code about PDFPlugin?#

I have installed the new PDF plugin, But it seems does not support Chinese display, do you have any solution? or where can i get the source code about PDFPlugin, thx!

- Louise 5-July-2007

Source is available at the project page at If you get it to support chinese, please contribute back your changes!

-- PålBrattberg

No images#

I'm using jspwiki2pdf-jar-with-dependencies version 2.1.1 with JSPWiki 2.4.103 and Tomcat 6.0.14. BaseURL is customized:

 jspwiki.baseURL= http://myserver:8080/wiki/
Here two interesting lines from the log file:
 DEBUG FOP  - File not found: http://myserver:8080/wiki//wiki/attach/Workflow/registry-sized.png
 ERROR  - Image not available:

The correct path to the image would be: http://myserver:8080/wiki/attach/Workflow/registry-sized.png
Were does the additional "/wiki/" came from ? Any hints ? Thanks.

- Alexander, 28-Oct-2007

Image does not work for me either until I change the linking to absolute:

 jspwiki.baseURL= http://myserver:8080/wiki/

--AnoCow, 02-Jan-2008



In combination with NTLM Authentication

If you install an Authentication scheme and if the image files (.../attach/...) require Authentication to be accessed, then jspwiki2pdf will NOT be able to access those images. This because jspwiki2pdf runs in the server context (not an authenticated user of itself!) and not in the client browser. To solve this, you must a way to remove the authentication constraint on the files jspwiki2pdf may have to include.

I'm using the latest jspwiki2pdf-jar-with-dependencies-2.1.jar version and text to pdf works fine. But if I have some images in my wiki-sites, they wont be displayed in pdf-sites. In the discussion is an similar problem described, but the BASE url is correct and the links are set to absolute. Here is the output:
Tidy (vers 4th August 2000) Parsing "InputStream"
line 152 column 16 - Warning: <table> lacks "summary" attribute
line 172 column 2 - Warning: <table> lacks "summary" attribute
line 182 column 1 - Warning: replacing element</p> by <br>
line 182 column 1 - Warning: inserting implicit <br>
line 208 column 3 - Warning: <table> lacks "summary" attribute

InputStream: Document content looks like HTML 4.01 Transitional
5 warnings/errors were found! 
I'm using the image-plugin as follows
[{Image src='sample01.jpg' alt='sample 1' caption='sample 1'}]
Does someone have an idea?
--Leif, 08.10.2007
Same, here, content is correct but no images. Same warnings for the images
I am having the same issue with images, they don't appear, and I get the same warning. Any idea?
--Bruno, 21-Jun-2011

Does not support breakTitleWithSpaces#

If jspwiki.breakTitleWithSpaces is set to true in, the plugin will attempt to generate a PDF using the page title that has spaces rather than the correct page name that does not.

Have you thought of generalizing PDF Plugin to FOP Plugin? It would be nice to output rtf or word XML as well.

I tried PDF Plugin on IBM JDK 1.6

I run JSPWiki as ROOT context


If you print a page containing images you get

javax.servlet.ServletException: java.lang.AbstractMethodError: org/w3c/dom/Node.isSameNode(Lorg/w3c/dom/Node;)Z

root cause

java.lang.AbstractMethodError: org/w3c/dom/Node.isSameNode(Lorg/w3c/dom/Node;)Z Source) Source) Source) Source) Source)<init>(Unknown Source)
	GregorSamsa.transform(<generated>) Source) Source) Source)

another one:

HTTP Status 500 -

type Exception report


description The server encountered an internal error () that prevented it from fulfilling this request.


javax.servlet.ServletException: java.lang.NullPointerException

root cause


--J��rgenWeber, 26-Mar-2008

It seems that I found the reason for the problem but not the solution
I tried with many many pages, and found all the pages uses the [1] and [#1] as a footer note causes this exception,
I hope this helps solving the problem
Amr Bedair

---GreggLowrimore, 16-Feb-2011

I've looked and Google'd to no avail. What's the fix for this error:

javax.servlet.ServletException: java.lang.NoSuchMethodError: org.apache.xmlgraphics.java2d.GraphicContext.<init>(Lorg/apache/xmlgraphics/java2d/GraphicContext;)V

root cause

java.lang.NoSuchMethodError: org.apache.xmlgraphics.java2d.GraphicContext.<init>(Lorg/apache/xmlgraphics/java2d/GraphicContext;)V

--- Update from GreggLowrimore - 07-Mar-2011

I was able to get this plugin working, although sometimes it just renders a white page, but the actual PDF is indeed still generated -- I just have to save the file out from Firefox and the PDF rendering is there.

What I did was to remove using the jar with dependencies and go with the no-dependencies jar file and then gather up all the dependent jars on my own. But now it's "working". Woot!

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-35) was last changed on 15-Nov-2011 11:51 by xiaochang619