Closed GoogleCodeExporter closed 8 years ago
Please provide a solution to fix this issue?
Original comment by ahmed.na...@gmail.com
on 8 Jul 2014 at 10:36
The solution is relatively simple, actually.
Open "/src/org/alivepdf/pdf/PDF.as" and replace the save method (line 3473, at
least in version "AlivePDF 0.1.5 RC") with the following.
Note that the only modifications are to the "case Method.REMOTE :" block; the
rest is untouched.
public function save ( method:String, url:String='',
downloadMethod:String='inline', fileName:String='generated.pdf',
frame:String="_blank" ):*
{
dispatcher.dispatchEvent( new ProcessingEvent ( ProcessingEvent.STARTED ) );
var started:Number = getTimer();
finish();
dispatcher.dispatchEvent ( new ProcessingEvent ( ProcessingEvent.COMPLETE, getTimer() - started ) );
buffer.position = 0;
var output:* = null;
switch (method)
{
case Method.LOCAL :
output = buffer;
break;
case Method.BASE_64 :
output = Base64.encode64 ( buffer );
break;
case Method.REMOTE :
//Modified on 2014.07.21 to resolve a recent change to Flash Player
//(introduced in version 13.0.0.214) that broke AlivePDF. As of this version of
//Flash, the original AlivePDF code produced the following runtime error:
//SecurityError: Error #3769: Security sandbox violation: Only simple headers can be used with navigateToUrl() or sendToUrl().
//
//For details, and the solution, see:
//https://forums.adobe.com/message/6398364#6398364
var bytesTemp : ByteArray = buffer;
var sendRequest:URLRequest =new URLRequest(url+'?name='+fileName+'&method='+downloadMethod);
sendRequest.method = URLRequestMethod.POST;
sendRequest.data = bytesTemp;
navigateToURL(sendRequest, '_blank');
break;
default:
throw new Error("Unknown Method \"" + method + "\"");
}
return output;
}
You may need to modify the following line to work with your particular
server-side implementation, though:
var sendRequest:URLRequest =new
URLRequest(url+'?name='+fileName+'&method='+downloadMethod);
BAM! Solved! :)
Original comment by indietor...@gmail.com
on 21 Jul 2014 at 7:12
Already tried this.. but no luck.... with above code changes the binary data
i.e buffer is not passing to the server side script.. did this worked for you?
Original comment by ahmed.na...@gmail.com
on 22 Jul 2014 at 8:47
Fixed in PDF.as
Also on server side, you need to replace $GLOBALS["HTTP_RAW_POST_DATA"]
by: file_get_contents('php://input')
Original comment by cgauth...@gmail.com
on 28 Feb 2015 at 3:23
This issue was closed by revision r293.
Original comment by cgauth...@gmail.com
on 28 Feb 2015 at 3:23
Original issue reported on code.google.com by
ahmed.na...@gmail.com
on 8 Jul 2014 at 10:36