Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Unable to create PDF using XSJS

$
0
0

I am trying to generate PDF content using XSJS. Following is the code. THe PDF is generating but when I try to ope, it says failed to load the file. When I try it on IE, it says its corrupted. Pl. suggest what I am missing in this code.

 

try {

   

//$.response.headers.set("Content-Disposition", "Content-Disposition: attachment; filename=test.pdf"); 

$.response.headers.set('Content-Disposition', 'attachment; filename ="test.pdf"');

          $.response.contentType = "application/pdf"; 

          $.response.setBody('ab naresh test');

$.response.status = $.net.http.OK; 

}

catch (e) { 

          $.response.setBody("Error while downloading : "+e); 

          $.response.status = 500; 

}


Viewing all articles
Browse latest Browse all 6412

Trending Articles