Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 284885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:29:47+00:00 2026-05-12T05:29:47+00:00

I am a new bee to flex. What i am trying to do is

  • 0

I am a new bee to flex.
What i am trying to do is to generate and save the layout design which nothing but canvas to a pdf format at the server. Currently i am able to display the pdf in browser (see the function below:) but cannot save the file at the server.

  private function continueToPdf():void{
            myPDF = new PDF(  Orientation.LANDSCAPE, Unit.MM, Size.A4 );
            myPDF.setDisplayMode ( Display.FULL_WIDTH ); 
            myPDF.addPage();
            myPDF.addImage(layout_cnv);
            myPDF.save( Method.REMOTE, "http://flexindia.org/designtool/upload/create.php",Download.INLINE ,"drawing.pdf" );
     }

where layout_cnv is a canvas.Also i am using AlivePDF.swc lbrary for this.
The php file at server is create.php

                   <?php
                 $method = $_GET['method'];
                 $name = $_GET['name'];

                 if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {

// get bytearray
$pdf = $GLOBALS["HTTP_RAW_POST_DATA"];

// add headers for download dialog-box
header('Content-Type: application/pdf');
header('Content-Length: '.strlen($pdf));
header('Content-disposition:'.$method.'; filename="'.$name.'"');
echo $pdf;

     }  else echo 'An error occured.';

           ?>

Can someone help me please.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:29:48+00:00Added an answer on May 12, 2026 at 5:29 am

    Finally after few days I’ve discovered the solution for the aforesaid problem.
    Here for saving the file locally at server i just need to do some changes in the following function as:

          private function continueToPdf():void{
                        myPDF = new PDF(  Orientation.LANDSCAPE, Unit.MM, Size.A4 );
                        myPDF.setDisplayMode ( Display.FULL_WIDTH ); 
                        myPDF.addPage();
                        myPDF.addImage(layout_cnv);
                        myPDF.save( Method.REMOTE, "create.php",Download.INLINE ,"drawing.pdf" );
                     }
    

    Where create.php is the server script defined as follows:

         <?php
    
          $fp = fopen( 'upload/drawing.pdf', 'wb' );
           fwrite( $fp, $GLOBALS['HTTP_RAW_POST_DATA' ] );
           fclose( $fp ); 
           ?>
    
        cheers :-) !!!
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've bee reading up on git and git-svn. I'm pretty new to git but
I m a new bee to Android world. I have a listview which has
I'm new bee to spring. Just started my sample application in sprinv mvc. But,
I am a new-bee in Linux and was trying to install OpenCV in Linux.
New to javascript, but I'm sure this is easy. Unfortunately, most of the google
new_story GET /story/new(.:format) {:action=>new, :controller=>stories} edit_story GET /story/edit(.:format) {:action=>edit, :controller=>stories} story GET /story(.:format) {:action=>show,
New to all this so forgive my ignorance. I am trying to figure out
I am a new bee in hadoop - big data analysis. I am referring
Hello I am new bee to the iphone apps development is there a way
I'm a new bee in JFace. My table viewer alloc code is: viewer =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.