Git Product home page Git Product logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 10, 2024
Please provide a solution to fix this issue?

Original comment by [email protected] on 8 Jul 2014 at 10:36

from alivepdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 10, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 10, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 10, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 10, 2024
This issue was closed by revision r293.

Original comment by [email protected] on 28 Feb 2015 at 3:23

from alivepdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.