Archive for December 2008

Display PDF document in SharePoint

Rather than merely link to a pdf file, why not display the pdf right within a SharePoint page?

Add a Page Viewer web part and configure it like this.

SharePoint Page Viewer Web Part - Pdf configuration

To make the pdf display without the adobe tool bar and scroll bars, make sure to add parameters to the PDF’s URL.

The full URL to the pdf file should look something like this:
/Shared Documents/doc.pdf#toolbar=0&navpanes=0&scrollbar=0

For more parameters see this documentation:
http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf

setting SharePoint buttons to ignore jquery validation

I’m using JQuery with SharePoint. When using the Validation plug-in I had some trouble with the buttons on the Tool Part causing validation errors and preventing me from saving changes to the web part configuration. Thankfully, each of the buttons had the class “UserButton” assigned. So this bit of code fixed the problem.

$(".UserButton").addClass("cancel");

The validation plug-in will now ignore the click events on these buttons because they’ve been tagged as “cancel”.