The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Azure Virtual Machines!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

After Move the DB to Azure server, My PDF functionality is not working.Let me know what is the issue? RRS feed

  • Question

  • HI, 

    Recently we moved the Share point Content DB to Azure.After moving Convert to PDF custom button in the webpart page is not Loading the Images and Videos. We used wkhtmltopdf latest version(0.12.5). 

    The webpart page is  having html content with content,images and one small video. 

    In Onpremise Loading all things perfectly. After move only the DB to Azure, Images are not loading. We are used azure VM only for storing our database.

    The Convert to PDF custom button code is given below


    protected void btnConver_Click(object sender, EventArgs e)
                    #region file download code
                    string wkhtmlToPdfExePath = HttpContext.Current.Server.MapPath(@"~\bin\wkhtmltopdf.exe");
                    string expPdfFname = Request.Url.Segments.Last().Contains('.') ? Request.Url.Segments.Last().Split('.')[0] + ".pdf" : ConfigurationManager.AppSettings["expPdfFname"];

                    byte[] buffer = GetFileInBytes(divContent.Text, wkhtmlToPdfExePath);
                    HttpContext.Current.Response.ContentType = "application/pdf";
                    HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + expPdfFname);
                    HttpContext.Current.Response.Buffer = true;
                catch (Exception ex)

    Could you Please look and provide a solution/root cause of the issue?

    Monday, August 27, 2018 6:44 AM

All replies

  • Hi Sudhir. Not sure your question has reached the correct forum. 

    How are you hosting your DB in Azure? Are you using an Azure Virtual Machine, Cloud Service, Azure DataBase? 

    Monday, August 27, 2018 8:42 PM
  •  I am using Azure Virtual Machine hosted the DB in Azure.

    let me know why i am facing this issue?

    We are using ADFS Authentication and For Images  we used https.
    Tuesday, August 28, 2018 6:49 AM
  • Would you be able to get a network trace of when you are trying to pull the images to see if you have any errors popping up? 
    Tuesday, August 28, 2018 5:48 PM
  • No errors are popup.May be i think arguments passing is different.please provide the correct code to generate a pdf in AZURE?
    Monday, September 3, 2018 3:01 PM
  • As for converting to PDF the code will vary based on each platform and how you are developing your site. 

    Are you using IIS in an Azure VM? 

    Tuesday, September 4, 2018 7:00 PM
  • tried Usercontrol with .net code. For Application Pool we used IIS  server.Code Path will be from IIS too.
    Wednesday, September 5, 2018 6:34 AM
  • The same code you run on prem should work in Azure. If you have the application running in IIS on prem and working then once deploying to Azure it should maintain functionality.

    Did you make sure to have the correct ports open in both the Guest OS firewall as well as the Network Security Groups? 

    Wednesday, September 5, 2018 10:30 PM
  • Just checking in if you have had a chance to see the previous response. We need the above requested information to understand/investigate this issue further.
    Tuesday, September 11, 2018 5:14 AM