本文整理匯總了Java中org.springframework.http.MediaType.APPLICATION_PDF_VALUE屬性的典型用法代碼示例。如果您正苦於以下問題:Java MediaType.APPLICATION_PDF_VALUE屬性的具體用法?Java MediaType.APPLICATION_PDF_VALUE怎麽用?Java MediaType.APPLICATION_PDF_VALUE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.springframework.http.MediaType
的用法示例。
在下文中一共展示了MediaType.APPLICATION_PDF_VALUE屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: defendantResponseCopy
@ApiOperation("Returns a Defendant Response copy for a given claim external id")
@GetMapping(
value = "/defendantResponseCopy/{externalId}",
produces = MediaType.APPLICATION_PDF_VALUE
)
public ResponseEntity<ByteArrayResource> defendantResponseCopy(
@ApiParam("Claim external id")
@PathVariable("externalId") @NotBlank String externalId
) {
byte[] pdfDocument = documentsService.generateDefendantResponseCopy(externalId);
return ResponseEntity
.ok()
.contentLength(pdfDocument.length)
.body(new ByteArrayResource(pdfDocument));
}
示例2: claimIssueReceipt
@ApiOperation("Returns a Claim Issue receipt for a given claim external id")
@GetMapping(
value = "/claimIssueReceipt/{externalId}",
produces = MediaType.APPLICATION_PDF_VALUE
)
public ResponseEntity<ByteArrayResource> claimIssueReceipt(
@ApiParam("Claim external id")
@PathVariable("externalId") @NotBlank String externalId
) {
byte[] pdfDocument = documentsService.generateClaimIssueReceipt(externalId);
return ResponseEntity
.ok()
.contentLength(pdfDocument.length)
.body(new ByteArrayResource(pdfDocument));
}
示例3: legalSealedClaim
@ApiOperation("Returns a sealed claim copy for a given claim external id")
@GetMapping(
value = "/legalSealedClaim/{externalId}",
produces = MediaType.APPLICATION_PDF_VALUE
)
public ResponseEntity<ByteArrayResource> legalSealedClaim(
@ApiParam("Claim external id")
@PathVariable("externalId") @NotBlank String externalId,
@RequestHeader(HttpHeaders.AUTHORIZATION) String authorisation
) {
byte[] pdfDocument = documentsService.getLegalSealedClaim(externalId, authorisation);
return ResponseEntity
.ok()
.contentLength(pdfDocument.length)
.body(new ByteArrayResource(pdfDocument));
}
示例4: countyCourtJudgement
@ApiOperation("Returns a County Court Judgement for a given claim external id")
@GetMapping(
value = "/ccj/{externalId}",
produces = MediaType.APPLICATION_PDF_VALUE
)
public ResponseEntity<ByteArrayResource> countyCourtJudgement(
@ApiParam("Claim external id")
@PathVariable("externalId") @NotBlank String externalId
) {
byte[] pdfDocument = documentsService.generateCountyCourtJudgement(externalId);
return ResponseEntity
.ok()
.contentLength(pdfDocument.length)
.body(new ByteArrayResource(pdfDocument));
}
示例5: settlementAgreement
@ApiOperation("Returns a settlement agreement for a given claim external id")
@GetMapping(
value = "/settlementAgreement/{externalId}",
produces = MediaType.APPLICATION_PDF_VALUE
)
public ResponseEntity<ByteArrayResource> settlementAgreement(
@ApiParam("Claim external id")
@PathVariable("externalId") @NotBlank String externalId
) {
byte[] pdfDocument = documentsService.generateSettlementAgreement(externalId);
return ResponseEntity
.ok()
.contentLength(pdfDocument.length)
.body(new ByteArrayResource(pdfDocument));
}
示例6: defendantResponseReceipt
@ApiOperation("Returns a Defendant Response receipt for a given claim external id")
@GetMapping(
value = "/defendantResponseReceipt/{externalId}",
produces = MediaType.APPLICATION_PDF_VALUE
)
public ResponseEntity<ByteArrayResource> defendantResponseReceipt(
@ApiParam("Claim external id")
@PathVariable("externalId") @NotBlank String externalId
) {
byte[] pdfDocument = documentsService.generateDefendantResponseReceipt(externalId);
return ResponseEntity
.ok()
.contentLength(pdfDocument.length)
.body(new ByteArrayResource(pdfDocument));
}
示例7: generateFromHtml
@APIDeprecated(
name = "/api/v1/pdf-generator/html",
docLink = "https://github.com/hmcts/cmc-pdf-service#standard-api",
expiryDate = "2018-02-08",
note = "Please use `/pdfs` instead.")
@ApiOperation("Returns a PDF file generated from provided HTML/Twig template and placeholder values")
@PostMapping(
value = "/html",
consumes = MediaType.MULTIPART_FORM_DATA_VALUE,
produces = MediaType.APPLICATION_PDF_VALUE
)
public ResponseEntity<ByteArrayResource> generateFromHtml(
@ApiParam("A HTML/Twig file. CSS should be embedded, images should be embedded using Data URI scheme")
@RequestParam("template") MultipartFile template,
@ApiParam("A JSON structure with values for placeholders used in template file")
@RequestParam("placeholderValues") String placeholderValues
) {
log.debug("Received a PDF generation request");
byte[] pdfDocument = htmlToPdf.convert(asBytes(template), asMap(placeholderValues));
log.debug("PDF generated");
return ResponseEntity
.ok()
.contentLength(pdfDocument.length)
.body(new ByteArrayResource(pdfDocument));
}