com.dynamicpdf.api.OutlineList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dynamicpdf-api Show documentation
Show all versions of dynamicpdf-api Show documentation
A Java Client API that uses the DynamicPDF API to create, merge, split, form fill, stamp, secure/encrypt PDF documents.
package com.dynamicpdf.api;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Represents a list of outlines
*/
public class OutlineList {
private List outlines = null;
OutlineList()
{
outlines = new ArrayList();
}
/**
* Adds an Outline
object to the outline list.
* @param text Text of the outline.
* @return The Outline
object that is created.
*/
public Outline add(String text)
{
Outline outline = new Outline(text);
outlines.add(outline);
return outline;
}
/**
* Adds an Outline
object to the outline list.
* @param text Text of the outline.
* @param url URL the action launches.
* @return The Outline
object that is created.
*/
public Outline add(String text, String url)
{
Outline outline = new Outline(text, new UrlAction(url));
outlines.add(outline);
return outline;
}
/**
* Adds an Outline
object to the outline list.
* @param text Text of the outline.
* @param input Any of the ImageInput
, DlexInput
, PdfInput
or PageInput
objects to create PDF.
* @param pageOffset Page number to navigate.
* @param pageZoom PageZoom
to display the destination.
* @return The Outline
object that is created.
*/
public Outline add(String text, Input input, int pageOffset, PageZoom pageZoom)
{
GoToAction linkTo = new GoToAction(input);
linkTo.setPageOffset(pageOffset);
linkTo.setPageZoom(pageZoom);
Outline outline = new Outline(text, linkTo);
outlines.add(outline);
return outline;
}
/**
* Adds an Outline
object to the outline list.
* @param text Text of the outline.
* @param input Any of the ImageInput
, DlexInput
, PdfInput
or PageInput
objects to create PDF.
* @param pageOffset Page number to navigate.
* @return The Outline
object that is created.
*/
public Outline add(String text, Input input, int pageOffset)
{
return add(text, input, pageOffset, PageZoom.FITPAGE);
}
/**
* Adds an Outline
object to the outline list.
* @param text Text of the outline.
* @param input Any of the ImageInput
, DlexInput
, PdfInput
or PageInput
objects to create PDF.
* @return The Outline
object that is created.
*/
public Outline add(String text, Input input)
{
return add(text, input, 0, PageZoom.FITPAGE);
}
/**
* @hidden
*/
public void addPdfOutlines(PdfInput pdfInput)
{
outlines.add(new Outline(pdfInput));
}
@JsonProperty
List getOutlines()
{
return this.outlines;
}
}