本文整理汇总了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));
}