InstantASP Support

Help & Support

Error when trying to export articles as PDFs within InstantKB

Known Issues

When exporting articles to PDF via the "Export to PDF" link shown to the right of content within InstantKB you may receive a message saying the PDF is corrupt.

This can occur if the HTML that makes up your article is not well formed or valid XHTML. I'm afraid the PDF parser is quite strict and requires well formed XHTML to generate the PDF document from the article.

Currently all HTML tags within your articles HTML must have end tags for the PDF parser to work correctly. For example the following is incorrect...

<p>Click on one of the <span class="uireferencebold"/>Knowledgebase links on the home page. The KnowledgeBase screendisplays:</p>

This should read...

<p>Click on one of the <span class="uireferencebold">Knowledgebase</span> links on the home page. The KnowledgeBase screendisplays:</p>

We do attempt within the editor to ensure markup is valid XHTML as you add and edit content within InstantKB however if you paste from word or web pages for example you may run into problems. The PDF parser expects well formed XHTML transitional markup otherwise the PDF generated will be corrupt.

In addition the Export to PDF feature within InstantKB cannot be applied when the article HTML contains <html>, <head>, <body> tags. This is a limitation of the ExportToPdf third party tool that InstantKB uses to export its content to PDF.

Note that the content that you export from InstantKB should be a valid XHTML (it doesn't matter whether the XHTML standard is Strict or Transitional).

Validating your articles HTML

Manually Validating your Article HTML

To check your articles are valid XHTML when adding or editing articles within InstantKB click the "HTML" link in the button of the rick text editor.

Select all of your article HTML and copy this into your computers clipboard.

Next visit the following URL...

Paste the article HTML you copied into your computers clipboard into the textarea provided on the W3C validator page. Click the "Check" button.

You should resolve any issues in your mark-up indicted as not well-formed by the W3C validator.

Using the built-in W3C validator within InstantKB

To help with this problem we have a HTML validation tool built directly into the InstantKB editor. To enable the W3C validation tool within InstantKB please navigate to your InstantKB installation and open the RadControls/Editor/ToolsFileFull.xml.

Locate the following XML...

<tool name="Cut" shortcut="CTRL+X"/>
<tool name="Copy" shortcut="CTRL+C"/>

Add a new tool element to display the W3C validator within the editor as shown below...

<tool name="XhtmlValidator" />
<tool name="Cut" shortcut="CTRL+X"/>
<tool name="Copy" shortcut="CTRL+C"/>

You can check the markup using the built-in W3C validator dialog or at

You can see an example of the new button and dialog below...

That's It!

We are working to make the PDF parser more flexible however this will take a little work. If you can't ensure your articles will be valid XHTML for now i would suggest disabling the Export to PDF option via the Member Permissions page within the Admin CP to avoid any further exceptions.

We hope this suggestion helps you resolve the problem. If we can assist further of course please don't hesitate to contact us or open a support ticket.

Optionally provide private feedback to help us improve this article...

Thank you for your feedback!

Comments require login or registration.


Product: InstantKB
Version: All Versions
Level: Novice
Article not rated yet.
Article has been viewed 12K times.
Last Modified: 2 Years Ago
Last Modified By: Ryan Healey


Similar Articles