Skip to content

Commit

Permalink
Merge pull request #93 from CybercentreCanada/analyze_render
Browse files Browse the repository at this point in the history
Add a submission param to add renders as extracted files
  • Loading branch information
cccs-rs authored Dec 20, 2023
2 parents c91d9c5 + ce25ae4 commit 6a56329
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions document_preview/document_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ def execute(self, request):
ocr_heuristic_id=ocr_heur_id,
ocr_io=ocr_io,
)
if request.get_param("analyze_render"):
request.add_extracted(
f"{self.working_directory}/{preview}",
name=img_name,
description=f"Here's the preview for page {i}",
)

if request.file_type == "document/pdf":
with open(ocr_io.name, "r") as fp:
Expand Down
5 changes: 5 additions & 0 deletions service_manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ submission_params:
value: false
default: false

- name: analyze_render
type: bool
value: false
default: false

- name: save_ocr_output
type: list
value: "no"
Expand Down

0 comments on commit 6a56329

Please sign in to comment.