Convert (payslip) from XML to PDF

The response returns a PDF encoded in base 64. The following example shows how to open the PDF document from the response of the API:

  

StreamReader reader = new StreamReader("c:\\input.txt");
string base64contentPDF = reader.ReadToEnd();
reader.Close();
byte[] byteArrayPDF = Convert.FromBase64String(base64contentPDF);
System.IO.File.WriteAllBytes("c:\\output.pdf", byteArrayPDF);

In this case, input.txt contains the content of the PDF node from the SOAP XML response.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<SalaryDocuments_GetAllPayslipsPDFByRunCompanyResponse xmlns="http://api.nmbrs.nl/soap/v2.0/CompanyService">
<SalaryDocuments_GetAllPayslipsPDFByRunCompanyResult>
<PDF>JVBERi0xLjcgCiXi48/TIAo......... </SalaryDocuments_GetAllPayslipsPDFByRunCompanyResult>
</SalaryDocuments_GetAllPayslipsPDFByRunCompanyResponse>
</soap:Body>
</soap:Envelope>
Volgen

Opmerkingen

Mogelijk gemaakt door Zendesk