Jeff-Lewis / alivepdf

Automatically exported from code.google.com/p/alivepdf
0 stars 0 forks source link

myPDF.save( Method.REMOTE, "pdf/create.php", "Moebel.pdf" ) will return generated.pdf #113

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When I try to save my PDFs with the create.php you provided the PDF will be
named "generated.pdf" no matter what name I pass.

The PDF itself seems to be ok and the code I use is:
myPDF.save( Method.REMOTE, "pdf/create.php", "Moebel.pdf" );

Any idea?

Thank you!

Original issue reported on code.google.com by frederik...@gmail.com on 28 Mar 2009 at 9:41

GoogleCodeExporter commented 8 years ago
Your missing the Download parameter try this:

myPDF.save( Method.REMOTE, "pdf/create.php",Download.ATTACHMENT, "Moebel.pdf" );

Original comment by yoshi...@gmail.com on 14 Jul 2009 at 6:37

GoogleCodeExporter commented 8 years ago
Could you pls post the create.php file.

I cannot find it in the svn

Original comment by komminen...@gmail.com on 19 May 2010 at 6:06

GoogleCodeExporter commented 8 years ago
<?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.';

?>

Original comment by ericdecoff on 22 Jun 2011 at 11:46