User Tools

Site Tools


fmk:ddv:1.4.0:getvaccinationcardaspdf

This is an old revision of the document!


GetVacciantionCardAsPDF

Servicen gør det muligt at hente et vaccinationskort som et PDF-dokument, så der sikres et ensartet udseende på tværs af systemer.

Svaret vil indeholde et PDF-dokument encoded i BASE64.

Forespørgsel
<ns2:GetVaccinationCardAsPDFRequest>
    <ns2:PersonCivilRegistrationIdentifier>1111111118</ns2:PersonCivilRegistrationIdentifier>
</ns2:GetVaccinationCardAsPDFRequest>

Svar

<ns2:GetVaccinationCardAsPDFResponse>
    <ns2:VaccinationCardAsPDF>
        <![CDATA[JVBERi0xLjQKJeL...RU9GCg==]]>
    </ns2:VaccinationCardAsPDF>
</ns2:GetVaccinationCardAsPDFResponse>
<code>
 
== Supplerende bemærkning ==
 
Anvendes en standard decoder er processen til at danne en PDF-fil simpel, følgende eksempel anvender javax.mail.internet.MimeUtility (fejlhåndtering m.v. er udeladt):
 
<code java>
String encodedPDF = (strengen i MedicineCardAsPDFStructure-elementet)
 
if(encodedPDF.startsWith("<![CDATA[")&&encodedPDF.endsWith("]]>")){
    encodedPDF = encodedPDF.substring(9, encodedPDF.length()-3);
}
 
BufferedInputStream is = new BufferedInputStream(MimeUtility.decode(new ByteArrayInputStream(encodedPDF.getBytes()), "BASE64"));
 
BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream("testoutput.pdf"));
 
byte[] buffer = new byte[is.available()];
 
is.read(buffer);
 
os.write(buffer);
 
is.close();
 
os.close();
fmk/ddv/1.4.0/getvaccinationcardaspdf.1545900350.txt.gz · Last modified: (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki