當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。