Class PdfHandler
java.lang.Object
io.goobi.viewer.controller.imaging.PdfHandler
Handles PDF generation and delivery requests, coordinating with the ContentServer PDF service.
- Author:
- Florian Alpers
-
Constructor Summary
ConstructorsConstructorDescriptionPdfHandler(WatermarkHandler watermarkHandler, AbstractApiUrlManager urls) Creates a new PdfHandler instance.PdfHandler(WatermarkHandler watermarkHandler, Configuration configuration) Creates a new PdfHandler instance. -
Method Summary
Modifier and TypeMethodDescriptiongetPdfUrl(StructElement doc, PhysicalElement page) Return the pdf-download url for the givenStructElementandPhysicalElement.getPdfUrl(StructElement se, PhysicalElement[] pages) Return the pdf-download url for the givenStructElementand a number ofPhysicalElements.getPdfUrl(StructElement doc, String label) Gets the url to the pdf for the givenStructElement.getPdfUrl(StructElement doc, String pi, String label) Gets the url to the pdf for the given pi and divId.Returns an existing pdf file from the media folder.Returns the url to a PDF build from the mets file for the givenpi.
-
Constructor Details
-
PdfHandler
Creates a new PdfHandler instance.- Parameters:
watermarkHandler- handler used to add footer/watermark parametersconfiguration- viewer configuration supplying the IIIF API base URL
-
PdfHandler
Creates a new PdfHandler instance.- Parameters:
watermarkHandler- handler used to add footer/watermark parametersurls- API URL manager used to build PDF download URLs
-
-
Method Details
-
getPdfUrl
Return the pdf-download url for the givenStructElementandPhysicalElement.- Parameters:
doc- struct element providing the logical section identifierpage- physical page whose image file is included in the PDF- Returns:
- the PDF download URL for the given struct element and single page
-
getPdfUrl
Return the pdf-download url for the givenStructElementand a number ofPhysicalElements.- Parameters:
se- struct element providing the logical section identifierpages- array of physical pages whose image files are included in the PDF- Returns:
- the PDF download URL for the given struct element and set of pages
-
getPdfUrl
Returns an existing pdf file from the media folder.- Parameters:
pi- persistent identifier of the recordfilename- name of the existing PDF file in the media folder- Returns:
- the URL to the existing PDF file in the media folder
-
getPdfUrl
public String getPdfUrl(StructElement doc, String label) throws PresentationException, IndexUnreachableException Gets the url to the pdf for the givenStructElement. The pi is the one of the topStruct element of the given StructElement- Parameters:
doc- struct element determining the scope and PI of the PDFlabel- The name for the output file (.pdf-extension excluded). If this is null or empty, the label will be generated from pi and divId- Returns:
- the PDF download URL for the given struct element
- Throws:
PresentationException- if any.IndexUnreachableException- if any.
-
getPdfUrl
public String getPdfUrl(StructElement doc, String pi, String label) throws PresentationException, IndexUnreachableException Gets the url to the pdf for the given pi and divId.- Parameters:
doc- struct element used to determine if a divID should be appendedpi- PI of the process from which to build pdf. Must be providedlabel- The name for the output file (.pdf-extension excluded). If this is null or empty, the label will be generated from pi and divId- Returns:
- the PDF download URL for the given PI, struct element, and label
- Throws:
PresentationException- if any.IndexUnreachableException- if any.
-
getPdfUrl
Returns the url to a PDF build from the mets file for the givenpi.- Parameters:
pi- persistent identifier of the recorddivID- optional logical section ID to restrict the PDF to a struct elementlabel- optional output filename without the .pdf extension- Returns:
- the PDF download URL built from the METS file for the given PI
-
getWatermarkHandler
-