Hello, I'm using PHP 4.3.0 with JAVA on IIS and the Apache FOP-Transformer Classes 0.20.1. The transformation from FO->PDF works fine, but if I try to return the resulting PDF-File by sending the header I just get "Page not found".
The Code for the transformation is:
<?php
// Define the Output
$file = uniqid("tmp").".pdf";
$output = "G:\phpuploads\".$file;
// Define the input
$fo = "G:\sonstiges\netjuke\lib\pdf\fo2pdf\headfoot.fo";
// Build Options for Transformation (FO-File, Output-Type, PDF-Output)
$options = array();
array_push($options,$fo,"-"."pdf",$output);
// Start transformation
$options = @new Java("org.apache.fop.apps.CommandLineOptions",$options);
$starter = $options->getStarter();
$starter->run();
// * Read result from PDF-File
$handle = fopen($output, "r+");
$read = fread($handle, filesize($output));
fclose($handle);
// Output result to Browser
header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename=Playlist.pdf");
print $read;
?>
Are there some chars that are sent before the header???
Thanks for help!