Skip to content

Commit

Permalink
Add custom header with APT message
Browse files Browse the repository at this point in the history
  • Loading branch information
thenav56 committed Dec 13, 2023
1 parent b4eba38 commit 6dad23f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 13 additions & 1 deletion app/pdf/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,20 @@ def make_pdf(
f"to S3 at path: {screenshot_filepath}"
)

header_template = """
<span style="font-size: 8px; color: #D2D4D1; margin: auto; text-align: center;">
This ATBD was downloaded from the NASA Algorithm Publication Tool (APT) Manuscript submitted to Earth and Space Science.
</span>
"""

page.wait_for_selector("#pdf-preview-ready", state="attached")
page.pdf(path=local_path, format="A4")
page.pdf(
path=local_path,
format="A4",
header_template=header_template,
footer_template="<span />",
display_header_footer=True,
)
browser.close()
logger.info(f"PDF generated at path: {local_path}")
if journal:
Expand Down
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ services:
depends_on:
- db-ready
- localstack-ready

mail:
image: namshi/smtp
restart: always
Expand Down Expand Up @@ -115,7 +116,7 @@ services:
AWS_DEFAULT_REGION: us-east-1
PROJECT_NAME: nasa-apt-api-local
API_VERSION_STRING: /v2
AWS_RESOURCES_ENDPOINT: http://localstack:4566
AWS_RESOURCES_ENDPOINT: ${AWS_RESOURCES_ENDPOINT:-http://localstack:4566}
S3_BUCKET: nasa-apt-dev-files
POSTGRES_ADMIN_CREDENTIALS_ARN: mocked_credentials_arn
# This URL omits the "http://" in order to remain consistent
Expand Down Expand Up @@ -156,7 +157,7 @@ services:
AWS_DEFAULT_REGION: us-east-1
PROJECT_NAME: nasa-apt-api-local
API_VERSION_STRING: /v2
AWS_RESOURCES_ENDPOINT: http://localstack:4566
AWS_RESOURCES_ENDPOINT: ${AWS_RESOURCES_ENDPOINT:-http://localstack:4566}
S3_BUCKET: nasa-apt-dev-files
POSTGRES_ADMIN_CREDENTIALS_ARN: mocked_credentials_arn
# This URL omits the "http://" in order to remain consistent
Expand Down

0 comments on commit 6dad23f

Please sign in to comment.