Skip Headers
Oracle® WebCenter Content Developer's Guide for Imaging
11g Release 1 (11.1.1)

Part Number E12784-05
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

11 Making REST Paged Rendition Requests

This section explains how to format an URL to request single page renditions of documents via REST (Representational State Transfer). You can use REST requests to simplify HTML display of a document by allowing the REST URL to be embedded in the SRC attribute of an IMG tag. This is useful for displaying document pages regardless of native application or browser support.

Format the REST URL as shown below, using the parameters described in Table 11-1. Also see the example URLs provided.

REST URL Format

http[s]://<hostname:port>/imaging/renderimage[/#pct][/#deg][/fitFITMODE][/crop#T#L#H#W][/annotations[true|false]][/page#][/download][/version#]/<documentId>.<format>

Note:

Include the parameter name in the same position (before or after) as specified in the REST URL format. For example, the number precedes the parameter name for pct and deg parameters, but follows the name for the page parameter.

REST URL Examples

Example URL Description

http://myserver:16000/imaging/renderimage/IPM7_170001.JPEG

Retrieves a JPEG of the 1st page of document ID IPM7_170001

http://myserver:16000/imaging/renderimage/50pct/page2/IPM7_170001.PNG

Retrieves a PNG of the 2nd page of a document at 50% scale

http://myserver:16000/imaging/renderimage/FITSCALE/crop0T0L100H100W/page5/IPM7_170001.JPEG

Fits the 5th page of a document into a 100-pixel square

http://myserver:16000/imaging/renderimage/page5/download/IPM7_170001.GIF

Downloads page 5 of a document as a gif

http://myserver:16000/imaging/renderimage/180deg/IPM7_170001.JPEG

Displays the 1st page of a document rotated 180 degrees

http://myserver:16000/imaging/renderimage/20pct/270deg/annotationsfalse/page3/download/version2/IPM7_170001.JPEG

Downloads page 3 of version 2 of a document at 20% of its original height, rotated 270 degrees, with annotations turned off


Table 11-1 REST URL Parameters

Parameters Description

pct

Specify the percent (as an integer) by which to scale the document. For example, 100 keeps the size unchanged, and 50 scales the document to 50% of its original size.

deg

Specify the rotation (in degrees) by which to rotate the document. Available rotations include: 0, 90, 180, and 270.

fit

To crop pages, specify a fit mode for this parameter (FITWIDTH, FITHEIGHT, or FITBEST) and a crop rectangle using the crop parameter. The page will fit the fit mode based on the specified crop dimensions.

(Note that this parameter is ignored if the crop parameter is not specified.)

crop

To crop pages, specify a crop rectangle's dimensions. The page will fit the specified fit mode (FITWIDTH, FITHEIGHT, or FITBEST) based on the specified crop rectangle's dimensions.

Use the format #T#L#H#W, which corresponds to a java.awt.Rectangle's top, left, height, and width properties. For example, for a rectangle where top=10, left=20, height=100, and width=200, specify the following:

crop10T20L100H200W

(Note that this parameter is ignored if the fit parameter is not specified.)

annotations

Specify true to apply annotations to the rendered page, or false to omit them.

page

Specify the page to display. For example, specify 2 to display the second page of a multi-page TIFF file.

Note that the page is returned to the caller as raw page data. It includes header information that specifies the proper mime type and suggested file name.

download

If this parameter is included, the client downloads the file in the Open/Save/Cancel browser dialog box, and the rendition is zipped for return to the caller.

If not included, the page is rendered only.

version

Specify the document version to render.

documentId

Specify the document ID to render (provided, for example, by the web interface).

format

Specify the format in which to render pages. Supported formats include: TIFF, PNG, GIF, and JPEG.