Export SharePoint Wiki to Word/PDF without 3rd party tools

Background

In our project, we use the SharePoint 2010 wiki to document our solutions. We needed to export this in PDF format when releasing the solution to production, so that we could pass over a formal documentation set to the operations team, and not just refer to a constantly changing wiki, which also had a number of pages irrelevant to operations. We looked at some 3rd party solutions, such as the Wiki Publisher from Bamboo solutions, but it did not do what we wanted. Fortunately, our project manager, found a solution. We extended this a bit, to better fit our need and to create a professionally looking Word document, which we could also export to PDF, of course.

How to export Wiki to Word

First, we added three additional fields to our Wiki library:

Name Purpose Type Valid values
Printout in System Documentation Exclusion of pages Choice yes/no
Printout Section Number High level sorting Choice 10 - Intro20 - Services30 - migrationetc.
Printout order inside section Lower level sorting Choice 10, 20, 30, etc.

 

All these fields were added to the standard view, and we created a datasheet view for more efficient setting of these values.

Then we created a new view, called "PrinterFriendlyView" as follows:

  1. Remove all columns except "Wiki Content"
  2. Set sorting to use the "Printout..." fields described above
  3. Set filter to be "Printout in System Documentation" = "yes"
  4. Set "Style" to "Newsletter"
  5. Set "Item Limit" to 999

Open this new view, and follow these steps:

  1. Mark all the text (this is a little awkward, I found it easiest to start from the bottom and go upwards)
  2. Open a blank document in Word and paste in all the content
  3. You will probably get some warnings, where clicking "No" is probably the best (I didn't test clicking "Yes")
    Warning text: "This operation will require copying many styles. Do you want to use Normal style instead?"
    Warning text:
  4. Change "Verdana, font 16" to "Heading 1" style (this may differ for your wiki - hopefully you have some consistent formatting for page headings that you can use)
    a. Open the "Search/replace" dialog in Word
    b. Click on "Replace"
    c. Click on "More"
    d. Click in the "Replace with" box and then click the "Format" button at the very bottom. Choose "Style -> Heading 1"
    e. Click in the "Find what" box and then click the "Format" button at the very bottom. Choose "Font -> Verdana, 16pt"
    f. Click "Replace All"
  5. Modify the style for "Heading 1", paragraph setting, to include a page break before each occurrence.
  6. Go to the start of the document
  7. Add a heading:"System Documentation", using "Title" style
  8. Add a text underneath: "Table of Contents, using "SubTitle" style
  9. Underneath, include a Table of Contents, using these steps (assuming Word 2010):
    a. In ribbon, click "References"
    b. Click "Table of Contents"
    c. At the bottom of the list, click "Insert Table of Contents..."
    d. In the creation dialog, set "Show levels" to 1, and click OK.
    e. Verify that the table of contents makes sense, you may, e.g., have some extra paragraphs marked as "Heading 1" where they should not have been.
  10. Choose "Save As" and set format to PDF.

Voila, your nice, professional looking PDF is ready for sending to your operations team!

The PDF will even have clickable links in the table of contents, thanks to the nice Word-to-PDF export functionaly.