Posts

Showing posts from March, 2015

PDF direct download with jQuery

Hi guys, There was a requirement in my project that needs to download a pdf out of html content. After some research we found that princeXML would be a good candidate for html to pdf conversion process as it provides a good api for pdf designing as we want.(Although we had to purchase a license). This blog post isn't about the princeXML but the front-end and back-end implementation of pdf direct download. Challenges The HTML content that we wanted to covert to a pdf was quite big. Due to various browser limitations on GET request's length, we couldn't just use  a simple GET request. Even though we have set up the correct response headers for our POST request browser seems to have not downloading the content as a pdf. (Ajax is not suitable). So the options we had were, either to use a hidden iframe submission or build a dynamic form and submit it on the fly. We chose form submission method  as it's the best option. Step 01 This is the client side JavaS