com.dynamicpdf.api.OutlineList Maven / Gradle / Ivy
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);
}
/**
* Adds an Outline
object to the outline list.
* @param pdfInput PdfInput of type PdfInput
object to import outlines to the PDF.
*/
public void addPdfOutlines(PdfInput pdfInput)
{
outlines.add(new Outline(pdfInput));
}
@JsonProperty
List getOutlines()
{
return this.outlines;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy