We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Create Azure functions to generate Documents

Hi Team,

I have few documents uploaded in Azure Storage. I need to attach a single pdf with different attachements. And I am able to do this with a Normal Java applications as below,

public Document addDocAttachments(Document doc, String destDir,
List filenames) throws Exception {

            FileSpecification filespecifications = null;

            try {
                    for (String document : filenames) {
                            filespecifications = new FileSpecification(destDir
                                            + File.separator + document, document);

                            /* Adding attachments to PDF happens here */
                    // Logger.info("File Attachments embedded to PDF");
            } catch (Exception e) {
                    throw new Exception(
                                    "Error occured while attaching documents to email PDF template. ",
            return doc;


However Now I would like to perform the same operation using Azure Function. All the pdfs are stored in Azure storage.The Function should have a HTTP Trigger and and take the pdf document and other attachments from the Azure storage and attach the attachments with the Pdf document. Now this attached pdf document should be download as response from the azure function. Please help me sharing the azure function code to perform this operation.



Thank you for contacting support.

Would you please elaborate on which platform do you want to create Azure function like Java, .NET Core etc. Moreover, you would need to apply Azure storage specific file handling approaches to upload or download the files and then you can use them with Aspose.PDF API as in case of normal Java application.