Class ViewerSectionPDFResource
java.lang.Object
io.goobi.viewer.api.rest.v1.records.media.ViewerSectionPDFResource
- Author:
- Florian Alpers
-
Constructor Summary
ConstructorsConstructorDescriptionViewerSectionPDFResource(ContainerRequestContext context, HttpServletRequest request, HttpServletResponse response, AbstractApiUrlManager urls, String pi, String divId, Boolean usePdfSource) -
Method Summary
Modifier and TypeMethodDescriptionde.unigoettingen.sub.commons.contentlib.servlet.model.PdfInformationReturns aggregated size information for the merged PDF of the given structural division.getPdf()Generates the PDF for the given structural division of the record and streams it to the response.
-
Constructor Details
-
ViewerSectionPDFResource
public ViewerSectionPDFResource(@Context ContainerRequestContext context, @Context HttpServletRequest request, @Context HttpServletResponse response, @Context AbstractApiUrlManager urls, @PathParam("pi") String pi, @PathParam("divId") String divId, @QueryParam("usePdfSource") Boolean usePdfSource) throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - Parameters:
context- JAX-RS container request contextrequest- incoming HTTP servlet requestresponse- outgoing HTTP servlet responseurls- API URL manager for building resource URIspi- persistent identifier of the recorddivId- logical div ID of the METS sectionusePdfSource- allow using single page files from pdf folder to render pdf- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
-
Method Details
-
getPdf
Generates the PDF for the given structural division of the record and streams it to the response.- Returns:
- streaming output that writes the generated pdf
-
getInfoAsJson
@GET @Path("/pdf/info.json") @Produces("application/json") public de.unigoettingen.sub.commons.contentlib.servlet.model.PdfInformation getInfoAsJson() throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionReturns aggregated size information for the merged PDF of the given structural division.- Returns:
- pdf info DTO whose title field holds the record identifier (not a descriptive title) and whose size is the total page file size for this division
- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-