Scribd Extension
Vendor
MindTouch
Type Script
Categories Documents
Requires MindTouch Deki 1.8.3 or later
Status Stable
License Free/Open Source
Manifest http://scripts.mindtouch.com/scribd.xml

 

Table of Contents

Description

This extension allows to view Adobe PDF, Microsoft Office, RTF, and Postscript documents in your wiki.

See also How to add a script, Using the Extension Dialog, Learn about DekiScript, Extensions Directory.


Configuration

The following configuration settings are required to run this script (unless shown as optional).

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


Functions

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%)


Script Source

<extension>
	<title>Scribd Extension</title>
	<label>Scribd</label>
	<copyright>Copyright (c) 2006-2009 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>


Samples

  Output

To embed the Scribd iPaper document:

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

 

Tag page
Viewing 4 of 4 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
I keep getting "Invalid Publisher ID". Tested w/ a newly registered ID of mine and public doc.
Posted 05:30, 12 Jun 2009
@nikejam Please file a bug. It's possible are was a regression or maybe they changed how their widget works. It happens and I would suspect the fix is fairly easy. Thanks.
Posted 15:04, 12 Jun 2009
Viewing 4 of 4 comments: view all
You must login to post a comment.