Comments (5)
Please provide a solution to fix this issue?
Original comment by [email protected]
on 8 Jul 2014 at 10:36
from alivepdf.
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 [email protected]
on 21 Jul 2014 at 7:12
from alivepdf.
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 [email protected]
on 22 Jul 2014 at 8:47
from alivepdf.
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 [email protected]
on 28 Feb 2015 at 3:23
- Changed state: Fixed
from alivepdf.
This issue was closed by revision r293.
Original comment by [email protected]
on 28 Feb 2015 at 3:23
from alivepdf.
Related Issues (20)
- Adding multiple image freeze the ui
- Grid problem
- addImage with displayObjects is not working
- AlivePDF does not print content of Flash Pro CS5.5 Stage
- AddImage() problem HOT 1
- savePDF() method HOT 1
- problems with mx cavas scaled on add image
- Chinese characters won't show on iOS
- PNG error "Missing palette in current picture" HOT 1
- Some addGrid bugs HOT 1
- .. HOT 1
- setAutoPageBreak(true) does not restore margin HOT 1
- Problems exporting IPA with AIR SDK 15 & especially 16 in Flash Builder
- AlivePDF Page elements are messed up with AIR SDK 16+
- Create documentation HOT 1
- Use workers to generate the PDF if possible
- Create a an issue and pull request template
- TLF to PDF
- Is this an active project?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alivepdf.