当前位置: 首页>>代码示例>>Java>>正文


Java MediaType.APPLICATION_PDF_VALUE属性代码示例

本文整理汇总了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));
}
 
开发者ID:hmcts,项目名称:cmc-claim-store,代码行数:16,代码来源:DocumentsController.java

示例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));
}
 
开发者ID:hmcts,项目名称:cmc-claim-store,代码行数:16,代码来源:DocumentsController.java

示例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));
}
 
开发者ID:hmcts,项目名称:cmc-claim-store,代码行数:17,代码来源:DocumentsController.java

示例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));
}
 
开发者ID:hmcts,项目名称:cmc-claim-store,代码行数:16,代码来源:DocumentsController.java

示例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));
}
 
开发者ID:hmcts,项目名称:cmc-claim-store,代码行数:16,代码来源:DocumentsController.java

示例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));
}
 
开发者ID:hmcts,项目名称:cmc-claim-store,代码行数:16,代码来源:DocumentsController.java

示例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));
}
 
开发者ID:hmcts,项目名称:cmc-pdf-service,代码行数:25,代码来源:PDFGenerationEndpoint.java


注:本文中的org.springframework.http.MediaType.APPLICATION_PDF_VALUE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。