Scribd

Installation

Follow these steps to install this script on your wiki.

  1. Go to System Settings inside the Control Panel.
  2. Under Extensions, click Add Script.
  3. Enter a descriptive name for the extension
  4. Under Configuration add the following to the Manifest field: http://scripts.mindtouch.com/scribd.xml
  5. Add extra configuration values as listed below under Configuration (If Configuration is not listed below, ignore this step.)
  6. Click on add script.

Related Links: DekiScript service, Extension Overview, DekiScript Overview, Extension Demos.


Overview

This extension allows to view Adobe PDF, Microsoft Office, RTF, and Postscript documents in your wiki. This script requires MindTouch Deki 1.8.3 or later.

Configuration:

Config KeyTypeDescription
pubidstrPublisher ID. Sign up for free at http://www.scribd.com/platform/start.

Functions:

  1. scribd

scribd(document, page, width, height) : xml

Embed a Adobe PDF, Microsoft Office, RTF, or Postscript document.

Parameters:

NameTypeDescription
documenturiURI of Document to view.
pagenum(optional) Start page for document to open on. (default: 1)
widthnum(optional) Viewer width. (default: 100%)
heightnum(optional) Viewer height. (default: 100%)


Source Code

<extension>
	<title>Scribd Extension</title>
	<label>Scribd</label>
	<copyright>Copyright (c) 2008 MindTouch, Inc.</copyright>
	<description>This extension allows to view Adobe PDF, Microsoft Office, RTF, and Postscript documents in your wiki.</description>
	<uri.help>http://wiki.developer.mindtouch.com/MindTouch_Deki/Extensions/Scribd</uri.help>
	<uri.logo>http://scripts.mindtouch.com/logos/scribd-logo.png</uri.logo>
	
	<config>
		<param name="pubid" type="str">Publisher ID. Sign up for free at http://www.scribd.com/platform/start.</param>
	</config>
	
	<function>
		<name>scribd</name>
		<description>Embed a Adobe PDF, Microsoft Office, RTF, or Postscript document.</description>
		<param name="document" type="uri">URI of Document to view.</param>
		<param name="page" type="num" optional="true">Start page for document to open on. (default: 1)</param>
		<param name="width" type="num" optional="true">Viewer width. (default: 100%)</param>
		<param name="height" type="num" optional="true">Viewer height. (default: 100%)</param>
		<return>
			<html xmlns:eval="http://mindtouch.com/2007/dekiscript">
				<head>
					<script type="text/javascript" src='http://www.scribd.com/javascripts/view.js' />
				</head>
				<body>
					<eval:if test="!config.pubid"><span style="color:red; font:bold;">Scribd is misconfigured ('pubid' configuration key is missing)</span></eval:if>
					<eval:else>
						<div eval:id="@id" />
						<script type="text/javascript">
							var scribd_doc = scribd.Document.getDocFromUrl(<eval:js>args.document</eval:js>, <eval:js>config['pubid']</eval:js>); 
							<eval:if test="args.width">scribd_doc.addParam('width', <eval:js>web.size(args.width)</eval:js>);</eval:if>
							<eval:if test="args.height">scribd_doc.addParam('height', <eval:js>web.size(args.height)</eval:js>);</eval:if>
							<eval:if test="args.page">scribd_doc.addParam('page', <eval:js>args.page</eval:js>);</eval:if>
							scribd_doc.write(<eval:js value="@id" />);  
						</script>
					</eval:else>
				</body>
			</html>
		</return>
	</function>
</extension>


Source Code


Output

To embed the Scribd iPaper document:

{{ scribd ("document.pdf") }} 

scribd example.png

Tag page
Viewing 2 of 2 comments: view all
It is not working at my site. I always get the message unable to load document. A parameter is missing.
Can someone help me ?
Is the XML scheme correct ?
Which parameters should i send with {{ scribd("document.pdf") }} as i attached the document to the same page.
Posted 21:13, 3 Apr 2008
You have to give the fully uri to the document as if you were to download it. Also, your page must be publicly accessible so that the Scribd service can retrieve the file for rendering.
Posted 00:57, 4 Apr 2008
Viewing 2 of 2 comments: view all
You must login to post a comment.
Powered by MindTouch Deki v.8.08.1a