Subscribe to News feed

Converting SharePoint Lists to PDF format using a SharePoint Designer Workflow

Posted at: 4:52 PM on 31 August 2010 by Muhimbi

List As one of the leading vendor in the SharePoint PDF Conversion market, we are frequently asked about how our products can be used to convert a SharePoint List into a PDF file. Up until now we have never had a good answer to this question as we mainly deal with the conversion of Office Documents and InfoPath forms.

However, as the new “4.0” version of the PDF Converter for SharePoint and PDF Converter Services support the conversion of HTML based content we can now export any SharePoint page, including ones that contain all entries in a list, to a PDF Document. This article shows how to put this together.
 

OK, let’s get going. In this example we use a simple Tasks list, so open your SharePoint site and create a Tasks lists if one doesn’t already exists.

Next up we need to create a page that displays all items in the list with as little of the SharePoint User Interface around it as possible. We could just use the list’s default view, but that would convert the Quick Launch menu to PDF as well, which doesn’t look very clean. To create a new page without the Quick Launch menu follow these steps:

  1. Navigate to the View All Site Content screen and click the Create button.
     
  2. In the Web Pages column select Web Part Page.
     
  3. Name the page PDFTasks.aspx, choose the Full Page, Vertical template and click the Create button.
     
  4. On the newly created page click Add a Web Part and add the Tasks list.
     
  5. Click the newly inserted Web Part’s Edit button and select the Modify Shared Web Part option.
     
  6. Click Edit the current View and select the columns you want to be included in the PDF file. For example % Complete, Due Data, Start Date and Status. Do not close the screen yet.
     
  7. Under the Item Limit section set the limit to an appropriately large number. We don’t want to page through the data in batches as we want to include all items in the PDF file.
     
  8. Click OK to save the changes.
     
  9. Save the page’s URL as we need it later. E.g. http://moss/sites/Management/FormServerTemplates/PDFTasks.aspx.

 

This new page will be used as the underlying layout of the PDF document. Feel free to modify it further in SharePoint designer / JQuery and remove more parts of the SharePoint user interface. You could also consider creating a minimalistic master page and applying that to the new PDFTasks page.
 

image

 
With the page in place the next thing we need to do is setup the automatic PDF Conversion using a SharePoint Designer workflow. In this example we generate a PDF file whenever the Tasks list is modified. The generated PDF file is stored in the Shared Documents library. Create the workflow as follows:

    1. Make sure you have the appropriate privileges to create workflows on a site collection.
       
    2. Create a new workflow using SharePoint Designer.
       
    3. On the Workflow definition screen associate the workflow with the Tasks list, tick the boxes next to both ‘Automatically start….’ options and proceed to the next screen.
       
    4. Add the Convert HTML to PDF action and click on this url and enter the URL to the page that was created in a previous step, e.g. http://moss/sites/Management/FormServerTemplates/PDFTasks.aspx.
       
    5. Click this file and enter the path and file name where the PDF file will be generated, e.g. Shared Documents/Tasks.pdf.
       
    6. Optionally change the generated page’s orientation from Portrait to Landscape.
       
    7. The user name and password are optional. By default the credentials the Muhimbi Conversion Service runs under will be used to open the web page. For now leave it empty.
       
    8. Click the Finish button to activate the workflow.

 

image

 

As a test enter one or more tasks. Every time a task is added or updated a PDF file is written to Shared Documents/Tasks.pdf. Open the PDF file to see the results.

 

In summary, the HTML conversion capability of the new version opens up a whole array of new possibilities.  As always, upgrades are completely free. Don’t hesitate to leave a comment below if you have any questions or contact us to discuss anything related to our products.

.





Labels: , , , , , ,

8 Comments:

  • Does this HTML to PDF works via Nintex workflow as well??

    By Anonymous Anonymous, At 29 April, 2011 00:13  

  • Regarding HTML to PDF. Currently the Nintex Activity we provide can deal with converting HTML files if they are stored in a document library, basically like any other file. However, if you need to convert a URL then you will need to invoke the 'SharePoint Designer HTML Activity' used in this post from your Nintex workflow, which is easy to do.

    A native Nintex workflow activity to convert URLs to PDF will be released in the next few months. Upgrades will be free.

    By Blogger Muhimbi, At 29 April, 2011 08:50  

  • HI,

    I am really keen to get this functionality working, but I keep getting an error which stipulates it can't find the destination url?

    I have tried the full file path and local to no avail, any idea?

    Many thanks.

    Julie

    Julie.bird@lfrs.org

    ps: am using SP2010

    By Anonymous Anonymous, At 02 January, 2012 13:15  

  • Hi Julie,

    I am sorry you are having some problems. Please send me the exact error message from the Windows Application Event Log (Event ID 41734).

    If the problem is with the output path then have a look at http://blog.muhimbi.com/2011/11/specifying-paths-and-file-names-when.html

    Let me know how you get on.

    By Blogger Muhimbi, At 02 January, 2012 13:23  

  • Hi

    I have a page where I user URL filters. I wish to use Nintex to convert this page indo PDF and store in a library.

    URL: site/testPpage?ID=23

    Is this possible with Muhimbi?

    Thanks,

    By Anonymous Anonymous, At 05 February, 2013 22:27  

  • Hi,

    The same Workflow Activity is available for Nintex Workflow (see http://blog.muhimbi.com/2011/08/convert-html-to-pdf-using-nintex.html)

    It supports exactly your requirement.

    By Blogger Muhimbi, At 06 February, 2013 11:41  

  • i installed the msi.. but still this workflow activity not coming in action menu.. do i need to activate any features?

    By Anonymous Anonymous, At 29 July, 2014 05:10  

  • Please follow Chapter 2 in the Administration Guide to deploy the software. In your case it sounds like you did not deploy the front end WSP. If you have any other questions then please contact support@muhimbi.com.

    By Blogger Muhimbi, At 29 July, 2014 07:54  

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link