Display options

The options operation element can be used to change the way documents are displayed.

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<operation xmlns="http://schema.webpdf.de/1.0/operation">
<options initialPage="1"
          initialView="fullscreen"
          magnification="fitActual"
          magnificationZoom="100"
          pageLayout="singlePage">

   <pageTransitions .../>

   <background .../>

   <headerFooter .../>

   <boxes .../>

 </options>
</operation>

{
"options": {
  "initialPage": 1,
  "initialView":"fullScreen",
  "magnification":"fitActual",
  "magnificationZoom":100,
  "pageLayout":"singlePage",

  "pageTransitions": {...},

   "background": {...},

   "headerFooter": {...},

   "boxes": {...},
 }
}

 

 

options element

 

<options initialPage="1"
        initialView="fullscreen"
        magnification="fitActual"
        magnificationZoom="100"
        pageLayout="singlePage">

 ...

</options>

"options": {
"initialPage": 1,
"initialView":"fullScreen",
"magnification":"fitActual",
"magnificationZoom":100,
"pageLayout":"singlePage",

 ...
}

 

initialPage (default: 1)

Defines the page that will be shown when the document is opened.

 

initialView (default: "none")

Defines which sub-windows will be opened when the PDF document is opened.

none = No special view

outlines = Opens the “Bookmarks" tab

thumbnails = Opens the “Thumbnails" tab

fullscreen = Opens the document in full screen mode

 

magnification (default: "fitWidth")

Sets the zoom settings according to a defined mode.

none = Uses the application’s default view

fitWidth = Page width

fitPage = Page dimensions

fitHeight = Page height

fitVisible = Page content width

fitActual = Uses the original page dimensions (100% zoom factor)

zoom = Sets an explicit magnification value

 

magnificationZoom (default: 100)

Used to set the value for zooming.

 

pageLayout (default: "singlePage")

Sets the page layout when the PDF document is opened.

singlePage = Individual pages

singlePageContinous = Continuous individual pages

twoPages = Page pairs

twoPagesContinous = Continuous page pairs

 

 

pageTransitions element

 

Can be used to change the document’s page transition animations. You can use multiple operations of this type in order to define various transitions for various page ranges in a single step.

 

<pageTransitions>

 <add .../>

 <remove .../>

</pageTransitions>

"pageTransitions": {

 "add": [...],

 "remove": [...]

}

 

 

add element (for page transitions)

 

Adds page transitions to a specific page range.

 

<remove>

 <pageTransition .../>

</remove>

"remove": [

 {

   "pageTransition": {...}

 }

]

 

 

remove element (for page transitions)

 

Removes page transitions from a specific page range.

 

<remove>

 <transitionSelection .../>

</remove>

"remove": [

 {

   "transitionSelection": {...}

 }

]

 

 

pageTransition element

 

Creates a page transition animation for a PDF full screen presentation. It is possible to specify several transition elements for different page ranges.

 

<pageTransition duration="1.0"

              style="blinds"

              direction="leftToRight"

               pages="*"

              autoScrollTime="1.0"

               autoScroll="true"

              flyScale="1.0"

               flyAreaOpaque="true"/>

"pageTransition":

 {

  "duration":1.0,

   "style":"blinds",

   "direction":"leftToRight",

   "pages":"*",

   "autoScrollTime":1.0,

   "autoScroll":"true",

   "flyScale":1.0,

   "flyAreaOpaque":"true"

 }

 

duration (Default: 1.0)

The page transition animation’s duration, in seconds. Make sure to avoid excessively high values, as certain reader programs will force the entire animation to be displayed without any option for interrupting it. Moreover, an excessively long animation can result in display and execution errors in the reader program. Values under 10 seconds are recommendable.

 

style (Default: "none")

The style of transition animation.

blinds = Crossfades

box = Crossfades in a rectangular pattern

cover = Covers

dissolve = Dissolves

fade = Fades

fly = Page flies in

glitter = Page dissolves and is replaced

push = Page is pushed out

split = Splits page

uncover = Uncovers page

wipe = Wipes page

none = No special effect

 

direction (Default: "none")

 The direction of the transition animation (provided that it can be applied to the animation).

 leftToRight = From left to right

 bottomToTop = From bottom to top

 rightToLeft = From right to left

 topToBottom = From top to bottom

 topLeftToBottomRight = From top left to bottom right

 none = Use the default value for the animation

 

pages (default: "")

Used to define the page number or page range (e.g., "1,5-6,9") to which the transition animation should be applied.

 

autoScrollTime (Default: 1.0)

 The time it will take for the next page to be automatically shown completely in full screen presentation mode.

 

autoScroll (Default: true)

 If true, the next page to be automatically shown completely in full screen presentation mode after a specific time.

 

flyScale (Default: 1.0)

 Option for the "fly" animation style – used to define the starting scale for the page that flies in. The page will smoothly be scaled from this starting scale all the way to the size of the page being displayed.

 

flyAreaOpaque (Default: false)

 Option for the "fly" animation style – used to define whether the page background for the page that flies in should be transparent initially.

 

 

transitionSelection element

 

Used to select a page range from which all transition animations should be removed.

 

<transitionSelection pages="*"/>

"pageTransition":

 {

   "pages":"*"

 }

 

pages (default: "")

Used to define the page number or page range (e.g., "1,5-6,9") from which the transition animations should be removed.

 

 

background element

 

Adds a background layer to the document or removes it (the "add" and "remove" elements are mutually exclusive, i.e., you must select one or the other).

 

<background>

<add .../>

<remove .../>

</background>

"background": {

 "add":{...},

 "remove":{...}

}

 

 

add element (for backgrounds)

 

Adds a background image or a solid colour background layer to the document (the "colorBackground" and "imageBackground" elements are mutually exclusive, i.e., you must select one or the other). A document is not allowed to have more than one background layer.

 

<add>

<colorBackground .../>

<imageBackground .../>

</add>

"add": {

"colorBackground":{...},

 "imageBackground":{...}

}

 

 

colorBackground element

 

Adds a solid-color background layer to the document.

 

<colorBackground color="#FFFFFF">

<settings .../>

</colorBackground>

 

"colorBackground":{

 "color":"#FFFFFF",

 "settings":{...}

}

 

color (Default: "#FFFFFF")

Used to set the colour for the background layer. Specified as an RGB value.

 

 

imageBackground element

 

Adds an image as a background layer to the document.

 

<imageBackground>

<settings .../>

<image .../>

</imageBackground>

"colorBackground": {

 "settings":{...},

 "image":{...}

}

 

 

image element (for backgrounds)

 

Used to define an image for generating a background. The image itself is passed with the "<data>" element.

 

<image>
  <data>iVBOR...S7xAAAAABJRU5ErkJggg==</data>
</image>

"image": {
 "data": {
  "value": "iVBOR...S7xAAAAABJRU5ErkJggg=="
 }
}

 

 

data element (for backgrounds)

 

Contains the file to be attached in "Base64 encoded" format.

 

<data>iVBOR...S7xAAAAABJRU5ErkJggg==</data>

"data": {
  "value": "iVBOR...S7xAAAAABJRU5ErkJggg=="
}

 

 

settings element (for backgrounds)

 

Defines basic configuration settings for generating background layers.

 

<settings relativeToPage="true"

        replaceExisting="false"

         scale="100"

         rotation="0"

         opacity="100">

<position .../>

<visibility .../>

<pages .../>

</settings>

"settings": {

 "relativeToPage":"true",

 "replaceExisting":"false",

"scale": 100,

"rotation": 0,

"opacity": 100,

 "position":{...},

 "visibility":{...},

 "pages":{...}

}

 

relativeToPage (Default: "true")

If true, the background layer will not be scaled relative to its own original size, but rather to the dimensions of the page containing it.

 

replaceExisting (Default: "false")

If true, an existing background layer will be automatically deleted and replaced with the new one. If false, an existing background layer will cause the operation to be aborted.

 

scale (Default: "100")

A percentage value used to specify the scaling for the background layer. This scaling can either be relative to the background layer’s original size or to the dimensions of the page containing it (depends on the "relativeToPage" parameter)

 

rotation (Default: "0")

A value between 0 and 360 degrees that is used to specify the background layer’s rotation.

 

opacity (Default: "100")

A percentage value that is used to specify the background layer’s transparency (100 percent means fully visible).

 

 

position element (for backgrounds)

 

Used to define the position of the background layer.

 

<position x="0.0"

        y="0.0"

         metrics="mm"

         position="center_center"/>

 

"position": {

 "x":0.0,

 "y":0.0,

 "metrics":"mm",

 "position":"center_center"

}

 

x (Default: 0.0)

X-axis position of rectangle.

 

y (Default: 0.0)

Y-axis position of rectangle.

 

metrics (default: "mm")

Unit used to specify the background’s X-axis / Y-axis position:

mm = Millimetres

px = Pixels

 

position (Default: "center-center")

Uses one of multiple preset positions in order to position the background on the page.

 

custom = Disable the use of a preset position.

top_left = Positions the background in the top left corner.

top_center = Positions the background in the centre on the top margin.

top_right = Positions the background in the top right corner.

center_left = Positions the background at the centre of the page, to the left.

center_center = Positions the background at the centre of the page.

center_right = Positions the background at the centre of the page, to the right.

bottom_left = Positions the background in the bottom left corner.

bottom_center = Positions the background in the centre on the bottom margin.

bottom_right = Positions the background in the bottom right corner.

 

 

visibility element (for backgrounds)

 

Used to define the element’s visibility in various use contexts.

 

<visibility onPrint="true"

          onScreen="true"/>

 

"visibility": {

 "onPrint":"true",

 "onScreen":"true"

}

 

onPrint (Default: "true")

If true, the background will be printed when the document is printed.

 

onScreen (Default: "true")

If true, the background will be shown when the document is displayed.

 

 

remove element (for backgrounds)

 

Removes a background layer from a document. As of this writing, this operation does not have any additional parameters. The "backgroundSelection" element, which must be included without fail, is meant simply as a placeholder for potential future detailed parameters.

 

<remove>

<backgroundSelection/>

</remove>

"remove":{

 "backgroundSelection":{}

}

 

 

headerFooter element

 

Adds a header and footer to the document or removes them (the "add" and "remove" elements are mutually exclusive, i.e., you must select one or the other).

 

<headerFooter>

<add .../>

<remove .../>

</headerFooter>

"headerFooter": {

 "add":{...},

 "remove":{...}

}

 

 

add element (for header and footer)

Adds a header and footer to the document . A document is not allowed to have more than one header and footer definition.

 

<add>

<headerFooterContent .../>

</add>

"add":{

 "headerFooterContent":{...}

}

 

 

headerFooterContent element

 

Used to define the header and footer that will be added to a document.

 

<headerFooterContent replaceExisting="false">

<pages .../>

<margin .../>

<font .../>

<header .../>

<footer .../>

</headerFooterContent>

"headerFooterContent": {

 "replaceExisting":"false",

"pages":{...},

"margins":{...},

"font":{...},

"header":{...},

"footer":{...}

}

 

replaceExisting (Default: "false")

If true, an existing header and footer definition will be automatically deleted and replaced with the new one. If false, an existing definition will cause the operation to be aborted.

 

 

pages element (for header and footer)

 

Used to specify the document pages to which new elements should be added.

 

<pages firstPageNumber="1">

<pageInterval .../>

</pages>

 

"pages": {

 "firstPageNumber":1,

 "pageInterval":{...}

}

 

firstPageNumber (Default: "1")

Used to specify the starting page for page number formats.

 

 

font element

 

Used to specify the font and formatting for the header and footer.

 

<font name=""

     size="10"
    underline="false"
    color="#000000"/>

"font": {
"name": "",

"size": 10,
"underline": false,
"color": "#000000"
}

 

name (default: "")

Used to specify the name of the font that should be used for the text output. If a font is not specified, "Helvetica" will be used.

 

size (default: 24)

Used to set the text size for the text output.

 

underline (Default: false)

If true, the text in the header and footer will be underlined.

 

color (Default: "#000000")

Used to set the colour for the text output. Specified as an RGB value.

 

 

header element

 

The header consists of three positions (left margin, centre, right margin). This element can be used to define the text contents that should be shown at these positions. The contents can consist of static and dynamic contents.

 

<header left="text"

     center="text"
    right="text"/>

"header": {
"left": "text",

"center": "text",
"right": "text"
}

 

left (Default: "")

Used to define the text content of the header on the left page margin.

 

center (Default: "")

Used to define the text content of the header in the centre.

 

right (Default: "")

Used to define the text content of the header on the right page margin.

 

 

footer element

 

The footer consists of three positions (left margin, centre, right margin). This element can be used to define the text contents that should be shown at these positions. The contents can consist of static and dynamic contents.

 

<footer left="text"

     center="text"
    right="text"/>

"header": {
"left": "text",

"center": "text",
"right": "text"
}

 

left (Default: "")

Used to define the text content of the footer on the left page margin.

 

center (Default: "")

Used to define the text content of the footer in the centre.

 

right (Default: "")

Used to define the text content of the footer on the right page margin.

 

 

remove element (for header and footer)

 

Removes a header and footer definition from a document. As of this writing, this operation does not have any additional parameters. The "headerFooterSelection" element, which must be included without fail, is meant simply as a placeholder for potential future detailed parameters.

 

<remove>

<headerFooterSelection/>

</remove>

 

"remove": {

 "headerFooter":{}

}

 

 

headerFooter element

 

Adds the header and footer elements to the document in different positions and can be used to remove them.

 

<headerFooter>

 <add... />

 <remove... />

</headerFooter>

"headerFooter": {

 "add": {...},

 "remove": {...}

}

 

 

add element (for header and footer)

 

Adds header and footer elements at various prepared positions.

 

<add>

 <headerFooterContent... />

</add>

"add": {

 "headerFooterContent": {...}

}

 

 

headerFooterContent element

 

Used to define content and positions for headers and footers.

 

<headerFooterContent replaceExisting="false"

                    firstPageNumber="1">

 <pages... />

 <margin... />

 <font... />

 <header... />

 <footer... />

</headerFooterContent>

"headerFooterContent": {

 "replaceExisting": false,

 "firstPageNumber": 1,

 "pages": {...},

 "margins": {...},

 "font": {...},

 "header": {...},

 "footer": {...}

}

 

replaceExisting (Default: "false")

If this value is set to "true", an existing header and footer will be replaced and overwritten. Otherwise, the operation will be aborted with an error if these elements exist in the document already.

 

firstPageNumber (Default: "1")

If this value is set to "true", an existing header and footer will be replaced and overwritten. Otherwise, the operation will be aborted with an error if these elements exist in the document already.

 

 

boxes element

 

Can be used to modify the document’s boxes. You can use multiple operations of this type in order to, for example, manipulate various boxes simultaneously in a single step.

 

<boxes>

 <resize... />

 <remove... />

</boxes>

"boxes": {

 "resize": [...],

 "remove": [...]

}

 

 

resize element (for page frames (boxes))

 

Used to change the dimensions of boxes in a specific page range.

 

<resize>

 <boxesResize... />

</resize>

"resize": [

 {

   "boxesResize": {...}

 }

]

 

 

boxesResize element

 

Used to change the dimensions of a specific box in a specific page range in the document.

 

<boxesResize pages="*"

      box="media_box">

 <dimensions... />

</boxesResize>

"boxesResize": {

 "pages": "*",

 "box": "media_box",

 "dimensions": {...}

}

 

pages (Default: "*")

Used to define the page(s) in which boxes should be scaled. The page number can be an individual page, a page range, or a list (separated with commas) (e.g., "1,5-6,9"). To specify "all pages," use an asterisk ("*").

 

box (Default: "media_box")

Used to select the box that should be scaled.

media_box = The page’s physical dimensions.

crop_box = The visible (printable) page area.

bleed_box = Untrimmed content position on the page (content dimensions plus trim box).

trim_box = Trimmed content position on the page (final content dimensions).

art_box = Position for special page content (images).

 

 

dimensions element

 

Used to define the position and dimensions of a containing element.

 

<margin x="0"

       y="0"

       width="0"

       height="0"

       metrics="mm"/>

"margin": {

 "x": 0,

 "y": 0,

 "width": 0,

 "height": 0,

 "metrics": "mm"

}

 

x (Default: "0")

The horizontal displacement of the element.

 

y (Default: "0")

The vertical displacement of the element.

 

width (Default: "0")

The width of the element.

 

height (Default: "0")

The height of the element.

 

metrics (default: "mm")

Unit of measurement for specifying dimensions and items:

mm = Millimetres

px = Pixels

 

 

remove element (for page frames (boxes))

 

Used to remove specific boxes from a specific page range.

 

<remove>

 <boxesRemove... />

</remove>

"remove": [

 {

   "boxesRemove": {...}

 }

]

 

 

boxesRemove element

 

Removes a page frame (box) from a document.

 

<boxesRemove pages="*"

       box="crop_box"/>

 

"boxesRemove": {

 "pages": "*",

 "box": "crop_box"

}

 

pages (Default: "*")

Used to define the page(s) from which boxes should be removed. The page number can be an individual page, a page range, or a list (separated with commas) (e.g., "1,5-6,9"). To specify "all pages," use an asterisk ("*").

 

box (Default: "crop_box")

Selects the box to remove.

crop_box = The visible (printable) page area.

bleed_box = Untrimmed content position on the page (content dimensions plus trim box).

trim_box = Trimmed content position on the page (final content dimensions).

art_box = Position for special page content (images).

 

 

margin element

 

Defines the outer offsets between an inner element and an outer element.

 

<margin top="0"

       right="0"

       bottom="0"

       left="0"

       metrics="mm"/>

"margin": {

 "top": 0,

 "right": 0,

 "bottom": 0,

 "left": 0,

 "metrics": "mm"

}

 

top (Default: "0")

The offset from the upper edge of the surrounding element.

 

right (Default: "0")

The offset from the right edge of the surrounding element.

 

bottom (Default: "0")

The offset from the bottom edge of the surrounding element.

 

left (Default: "0")

The offset from the left edge of the surrounding element.

 

metrics (default: "mm")

Unit for box specifications:

mm = Millimetres

px = Pixels

 

 

pages element

 

Used to specify the document pages to which new elements should be added.

 

<pages>

<pageInterval .../>

</pages>

"pages": {

 "pageInterval":{...}

}

 

 

pageInterval element

 

Used to define the document page range to which new elements should be added. Can be used to define a fixed interval from one page to another page.

 

<pagesInterval odd="true"

              even="true"

              pages="*"/>

 

"pageInterval": {

 "odd": true,

 "even": true,

 "pages":"*"

}

 

odd (Default: "true")

If true, the elements are also placed on pages with odd-numbered pages.

 

even (Default: "true")

If true, the elements are also placed on even-numbered pages.

 

pages (Default: "*")

Defines the pages of the PDF document to which new elements should be added. Either a single page or a range of pages (e.g., "1-5") can be defined. (Can only be used to define a single contiguous interval of consecutive pages.)