Skip to content

Azure Function that generate a PDF document from XML content.

License

Notifications You must be signed in to change notification settings

sergiokml/FunctionHtmlConvert

Repository files navigation


Azure Function


GitHub all releases


Function Azure that allows to convert an XML file to an HTML file following the standards for electronic invoices set by Servicio de Impuestos Internos.

Pdf417

Transforms the node "TED" to a barcode PDF417 and embeds it in the result as base64 image then, transforms the content via an XLST template. The file template must be hosted in an Azure storage blob container for consume.

The resulting file is content ready to convert to PDF in browser.

📝  Details

Azure Funtions 4.1.1
ZXing.Net 0.16.9
ZXing.Net Drawing 0.16.5-beta

✅  Requirements

🚀  Usage

This function can be hosted on a server and called from a POST request, upload the file and wait for the result in HTML content. You need config the Blob Container for host the template.

Curl:

curl --location 'http://localhost:30374/api/convert' --header 'Content-Type: application/xml' --data '@/C:/Users/.../file.xml'
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "ADConfig:Container": "templates-xslt", // Blob Container name
    "ADConfig:Template": "dte_fromat.xsl" // template name
  }

image

If the templates not exists into Blob Container you may use template from "Resources" proyect.

📫  Have a question? Found a Bug?

Feel free to file a new issue with a respective title and description on the FunctionHtmlConvert/issues repository.

❤️  Community and Contributions

I think that Knowledge Doesn’t Belong to Just Any One Person, and I always intend to share my knowledge with other developers, a voluntary monetary contribution or contribute ideas and/or comments to improve these tools would be appreciated.

Azure Function

📘  License

All my repository content is released under the terms of the MIT License.