Del via


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.

Comments

  • Anonymous
    February 10, 2012
    That sound like a solution that can helpme, I'll give it a try. Just wanted to say thanks, harald

  • Anonymous
    October 09, 2012
    Very clever and exactly what I am looking for.  Thanks for sharing!

  • Anonymous
    May 10, 2013
    Found this in May of 2013.  Incredibly useful, thanks!

  • Anonymous
    December 11, 2013
    The link above doesn't work.  Anybody have the original?  Would love to have it.

  • Anonymous
    February 20, 2014
    Thank you so much! This is exactly what we were looking for! Works excellent.

  • Anonymous
    June 03, 2014
    Fantastic tip. Just what I was looking for. Thank you very much for sharing.

  • Anonymous
    January 07, 2015
    When you mark the text and copy it into word it copies the shading. In sharepoint I selected newsletter style with no lines but the shading for every other page still shows up and transfers into the word document. How can you elminate this shading? When I change to to just newsletter it adds a border around it which is fine execept the border doesn't go across the bottom. How can Iget it to transfer without the shading and border?.

  • Anonymous
    April 14, 2015
    The original link can be found in here: web.archive.org/.../Export_SharePoint_Wiki.pdf

  • Anonymous
    December 17, 2015
    Thank you very much! Helped us a lot :-) Best regards Sebastian