I'm creating an object tag with jQuery to visualise a dynamic generated PDF file. In order to create it, I'm using the "data" attribute to include GET parameters in the url, so the server can identify what kind of file is needed.
$("#div").html("<object data='url?parameterX=1¶meterY=0' type='application/pdf'></object>");
in the same project, I now need to generate a pdf file with a dynamic generated picture. I'm able to do that with the html2canvas library and sending via POST the base64 value of the image, but since I need to show the file in the object tag, I'm unable to send the the base64 data as GET, and thus the browser shows the message "URL too long".
Is it possible create the Object tag with a complex parameter? I don't know if is possible send the information via POST.
Update
For now, the only way to solve this was the James Thorpe recommendation. with jquery ajax, i'm sending the base64 to the server and storing the value in a session variable. Something like this:
$.ajax({
url: "url",
dataType: "text",
type: "POST",
data: { image: canvas.toDataURL("image/png").replace("data:image/png;base64,", "") }
}).done(function (data) {
$("#div").html("<object data='url?parameterX=1' type='application/pdf'></object>");
}
however, i don't know if this is the best solution. i'm gonna leave the question open and i will try to provide any update if i found something useful.