Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New converter itextpdfa #117

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

New converter itextpdfa #117

wants to merge 10 commits into from

Conversation

jacopocarlini
Copy link
Contributor

@jacopocarlini jacopocarlini commented Jun 21, 2024

List of Changes

📁 Changed the library used to convert a .pdf file in .pdf/a

  • ➖ removed spire-pdf
  • ➕ added itextpdfa

👀 The license of itextpdfa is AGPL

Motivation and Context

💥 We have an error with the font when spire-pdf runs on a Docker container 🐳

2024-06-21T16:16:20.472989669Z: [INFO]        Caused by: java.lang.RuntimeException: class [com.spire.ms](http://com.spire.ms/).System.Exception: No ‘’ font found!
2024-06-21T16:16:20.473788867Z: [INFO]        com.spire.pdf.packages.sprhpf.spr┝⌺(Unknown Source)
2024-06-21T16:16:20.473798967Z: [INFO]        com.spire.pdf.packages.sprhpf.spr︼⌻(Unknown Source)
2024-06-21T16:16:20.473801767Z: [INFO]        com.spire.pdf.packages.sprpwo.spr®▁(Unknown Source)

How Has This Been Tested?

curl --location 'https://api.dev.platform.pagopa.it/printit/pdf-engine-node/v1/generate-pdf' \
--header 'Ocp-Apim-Subscription-Key: <your-secret>' \
--form 'template=@"Desktop/git/pagopa/pagopa-template-notice-pdf/output/TemplateSingleInstalment/template.zip"' \
--form 'data="{\"debtor\":{\"fullName\":\"Mario Rossi\",\"taxCode\":\"FFFCST83A15L113V\",\"address\":\"Via Roma\",\"buildingNumber\":\"15\",\"postalCode\":\"00100\",\"city\":\"Roma\",\"province\":\"RM\"},\"payee\":{\"logo\":\"https://pagopadprintitci.blob.core.windows.net/institutionslogoblob/00264560608%2Flogo.png\",\"name\":\"Comune di Frosinone\",\"taxCode\":\"00264560608\",\"sector\":\"Servizio Pagamenti (Test)\",\"additionalInfo\":\"info test\",\"channel\":{\"online\":{\"website\":true,\"app\":true},\"physical\":{\"data\":\"\"}}},\"notice\":{\"subject\":\"Avviso Pagamento di TEST\",\"amount\":\"1,00\",\"expiryDate\":\"31/12/2024\",\"qrCode\":\"PAGOPA|002|123456789012345678|00264560608|100\",\"refNumber\":\"123456789012345678\",\"cbillCode\":\"AMX61\",\"posteAccountNumber\":\"232323\",\"posteAuth\":\"AUT. 08/5 S3/81 53079 08129.07.20211\",\"posteDocumentType\":\"896\",\"posteDataMatrix\":\"codfase=NBPA;181234567890123456781200000023232310000000010038961P100264560608FFFCST83A15L113VMario Rossi                             Avviso Pagamento di TEST                                                                                                  A\",\"instalments\":{\"items\":[],\"discounted\":{},\"reduced\":{}}}}"' \
--form 'applySignature="false"'

Screenshots (if appropriate):

With the new library itextpdfa we have a valid PDF file:

Screenshot 2024-06-22 alle 12 04 15

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@jacopocarlini jacopocarlini changed the title new converter New converter itextpdfa Jun 22, 2024
Copy link

This pull request does not contain a valid label. Please add one of the following labels: [patch, minor, major, skip]

Copy link

sonarcloud bot commented Jun 22, 2024

@jacopocarlini jacopocarlini marked this pull request as ready for review June 22, 2024 10:05
Copy link

Comment this PR with update_code to update openapi.json and format the code. Consider to use pre-commit to format the code.

@jacopocarlini jacopocarlini marked this pull request as draft June 27, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants