我是一隻新的flex軟件。 我想要做的是生成並保存在服務器上的PDF格式的佈局設計,只有畫布。目前,我可以在瀏覽器中顯示PDF(請參閱下面的功能:),但無法將文件保存在服務器上。在服務器上保存PDF時的Flex問題
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");
}
其中layout_cnv是一個畫布。我也使用AlivePDF.swc lbrary。 在服務器PHP文件是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.';
?>
有人可以幫我請。
有人請幫助。 – 2009-07-08 14:21:21
我很困惑。客戶端是flex,服務器端是php。誰需要保存PDF,客戶端或服務器? – 2009-07-08 15:58:06