-
Notifications
You must be signed in to change notification settings - Fork 29
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
Export single credential as PDF #518
Comments
@jmcioffi4 @IsaacAirmet1 @lautom36 here are files:
|
PR: #523 |
@dmitrizagidulin & @lautom36 Keeping this in In Progress status because we will continue to test with more complex templates and scenarios. |
Sample HTML template from Atomic Jolt: <!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #f0f0f0; /* Optional: Set a background color */
}
.main-container {
display: flex;
flex-direction: column;
align-items: center;
max-width: 80%;
padding: 20px;
box-sizing: border-box;
}
.main-container img {
/* Add styles for the image if needed */
}
h2 {
margin: 10px 0;
}
.signatures-container {
display: flex;
justify-content: space-evenly;
width: 90%;
margin-top: 20px; /* Adjust as needed */
}
.signature {
display: flex;
flex-direction: column;
align-items: center;
}
p {
text-align: center;
margin: 10px 0;
}
</style>
</head>
<body>
<div class="main-container">
<div>image would go here</div>
<p>concede a</p>
<h2>{{ credential.subject.name }}</h2>
<p>el titulo profesional de</p>
<h2>{{ credential.name }}</h2>
<p>considerando que ha cumplido con los estudios correspondientes y satisfecho todas los requisitos necesarios.</p>
<p>Dado en la ciudad de Monterrey, estado de Nuevo León, el dia</p>
<p>{{ credential.awardedDate }}</p>
<div class="signatures-container">
<div class="signature">sig 1 <p>Rector y Presidente Ejecutivo</p></div>
<div class="signature">sig 2 <p>Rector de Profesional y Posgrado</p></div>
</div>
<p>Titulo Electronico folio control: {{ credential.evidence[0].narrative }}</p>
<p>Sello Autenticocion:</p>
<p>{{ credential.evidence[1].narrative }}</p>
<p>No. Certifico Autoridad:</p>
<p>{{ credential.evidence[2].narrative }}</p>
</div>
</body>
</html> |
Example credential: https://raw.githubusercontent.com/digitalcredentials/test-files/main/example-credentials-unsigned/render-method/tec-de-monterrey-unsigned-html-template.json Wallet isn't showing export as expected. |
Updating label to priority because we need this for Tec pilot. |
Dmitri exploring and debugging currently. |
Signed credential: {
"name": "Título Profesional e21.02",
"type": [
"VerifiableCredential",
"OpenBadgeCredential"
],
"id": "urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1",
"issuer": {
"id": "did:key:z6MkjSdgaUNWTQsH8RbkrNoxk98ZA2FHQsyEFEcHAEGhk3dB",
"url": "https://tec.mx/es",
"type": "Profile",
"name": "Instituto Tecnológico y de Estudios superiores de Monterrey",
"image": {
"id": "https://coursereport-production.imgix.net/uploads/school/logo/490/original/logo-tecnolo-cc-81gico-monterrey-boot-camp-20.jpg",
"type": "Image"
}
},
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.1.json",
{
"renderMethod": "urn:uuid:b2ab3546-228a-47a8-b97a-9a5646007c53",
"css3MediaQuery": "urn:uuid:c4c53282-e8e2-4914-83d8-566e25d2f899",
"digestMultibase": "urn:uuid:caef1a4e-67b8-4dfc-9881-2b51da7edc1b"
},
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"issuanceDate": "2020-12-16T00:00:00Z",
"credentialSubject": {
"type": [
"AchievementSubject"
],
"name": "Adolfo Daniel Javier Alberto Giese-Caballero Benavides",
"achievement": {
"type": [
"Achievement"
],
"id": "urn:uuid:7d9f1061-81b4-48d5-b6eb-6524c4074146",
"name": "Título Profesional",
"criteria": {
"type": "Criteria",
"narrative": "Javier Alberto Giese Ruiz has fulfilled the requirements to earn this degree. -- do we want to include other criteria here?"
},
"description": "Description content here?",
"fieldOfStudy": "Ingeniero en Sistemas Electrónicos",
"achievementType": "BachelorDegree"
},
"id": "did:key:z6MkpCSjiYdZe55pvraC8N9SNxthqtMfJQUry3Yhk8XwZ7co"
},
"evidence": [
{
"type": "Evidence",
"name": "Título Electrónico Folio Control",
"narrative": "M-A00500923-5"
},
{
"type": "Evidence",
"name": "Sello Autenticación",
"narrative": "RzWvSLK1vpxOltu/71LeuuoxC6lDJ0vEocVHjUjItgSj+GH50KophCABW3ZqPEVhIxEJ1dQAPS3TsNz+UepJu6EK4B2Y36+Z+D3j4bRCmBkdA/IQVd97Sp7itv9XUsgNIZicMEfrufhkrPCVvS7aOJ+nicISpU86lnZwAAU27HSw+5ca2hZ1OQ6an0bvd8/cPgsclldHUWsiSUsPESyoCeurd1nT03LoEwX4WrgQT6xSY+2HixOgGPWiR7mQV5tIlnNZvhT1BsGCMwr7XsL3Pbdgo2QCMYx1cRDatMWydjyMdRvgU/mAaHwdncxv1nAORfxruIFgr9W2Gjvi4OOyAQ=="
},
{
"type": "Evidence",
"name": "No. Certificado Autoridad",
"narrative": "00001000000123456789"
},
{
"type": "Evidence",
"name": "Sello Titulo",
"narrative": "Hjru5ABq7bOaDK5khME3A163xwNx2uHhX/3gRZ+0MM80i0Eok2v+7SbBhGGZ8ZDxDFrY6kusMXYWvw7rZidv9ZiBjJfp9YIYqixmvSEFtUfBhN/MZOF/tP7zhGRNPELu31GKE2jIyN7jAZB30xf7XOlZoIBuxPsiUljGcqaCStzdofOpJiN+NqvlzMs/LMYwny7OrIE5w65lPHbuocMl1nqlMGwfWioSbnHu8x52DQWa65VMEiknLTfMerZJ06ly7q/mI8tDpKgIAuhVY6WwN9c/8qrbGGZ2qqDCZmyiB75bjWQBIwMBXTV4QnfSnIy1tPbTra43utMkkb+ZhaFbUQ=="
},
{
"type": "Evidence",
"name": "Fecha Autenticacion",
"narrative": "1/27/2020 17:22:22"
},
{
"type": "Evidence",
"name": "Folio Digital",
"narrative": "701a5cf8-67va-4452-abc8-c18b1bb94be1"
}
],
"renderMethod": [
{
"id": "https://raw.githubusercontent.com/digitalcredentials/docs/main/credential-render-examples/tec-de-monterrey-test-example-template.html",
"type": "SvgRenderingTemplate2023",
"name": "PDF Display",
"css3MediaQuery": "@media (orientation: portrait)"
}
],
"proof": {
"type": "Ed25519Signature2020",
"created": "2024-03-14T00:52:35Z",
"verificationMethod": "did:key:z6MkjSdgaUNWTQsH8RbkrNoxk98ZA2FHQsyEFEcHAEGhk3dB#z6MkjSdgaUNWTQsH8RbkrNoxk98ZA2FHQsyEFEcHAEGhk3dB",
"proofPurpose": "assertionMethod",
"proofValue": "z4SRn6FmbibfTrbj9KUceRcFYS9rEJJ8vAyCvARz2MK5LnSsvuBwtutZbPooR2Ra6iB4a3EzR871m75QDbBLfrMpc"
}
} |
Implemented, last fix for it is in PR #599 |
Tried testing on testflight with this credential: { The export as PDF button isn't available in the share screen |
@kayaelle In the template, change |
Deployed in 2.0.23, closing this ticket |
On a dedicated single credential share window: Add an "Export as PDF" option below the create public link area (or below unshare/view link buttons if a link has been created. Please use a PDF icon in the button.
Requirements:
Only display the Export as PDF option if renderMethod is included in a credential, a link to an svg template is available in renderMethod and the svg file is readable, apply credential data to variables indicated in the svg template and render pdf to be downloaded using native mobile device dialog for saving/sharing.
Otherwise, the option should not exist. Let's include this in the testing script for LCW -- please let me know if a new issue is needed for that.
Needed for this issue:
Resources & Tools:
Please add this to testing script.
The text was updated successfully, but these errors were encountered: