Recriar arquivo PDF de Java para PHP

Eu tenho um WebService em Java (usando o Apache Axis) que obtém o id de um documento e esta chamada para JasperReports para criar um arquivo PDF (relatório criado anteriormente em java app - lado do servidor), para criar o relatório eu estou usando os métodos : JasperManager.fillReport e JasperExportManager.exportReportToPdf. O último retorna uma matriz de bytes. Meu webservice pega o array e o codifica em uma String Base64, o PHP recebe essa string como resposta do WebService.

Eu quero recriar o arquivo em PHP, mas não sei exatamente se isso é possível. Estou tentando fazer isso com o seguinte trecho:

private function createFileFromString($stringWithFile){
    header('Content-Description: File Transfer');
    header("Content-Type: application/pdf");
    header('Content-Disposition: attachment; filename=remesa.pdf');
    header('Cache-Control: must-revalidate');
    header('Pragma: public');
    ob_start();
    ob_clean();
    ob_flush();
    flush();
    $fp = file_put_contents("document.pdf", "w");
    fwrite($fp, base64_decode($stringWithFile));
    readfile($fp);
    ob_get_contents();
    fclose($fp);
    exit();
}

O WebService Retorna uma String Assim:

JVBERi0xLjQKJeLjz9MKNCAwIG9iaiA8PC9UeXBlL1hPYmplY3QvQ29sb3JTcGFjZS9EZXZpY2VS R0IvU3VidHlwZS9JbWFnZS9CaXRzUGVyQ29tcG9uZW50IDgvV2lkdGggMjg0L0xlbmd0aCAzNjc0 L0hlaWdodCA1MC9GaWx0ZXIvRENURGVjb2RlPj5zdHJlYW0K / 9ºJ / 4AAQSkZJRgABAgAAAQABAAD / 2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0 Hyc5PTgyPC4zNDL / 2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL / wAARCAAyARwDASIAAhEBAxEB / 8QAHwAAAQUBAQEBAQEA ...

Essa string tem o "PDF Header", começa assim:

% PDF-1.4% 4 4 0 obj <> stream ÿØÿà

Quando eu tento baixar o arquivo, o tamanho é de cerca de 4-5KB (e, o arquivo está danificado), mas a String de Resposta é de cerca de 180KB.

Isso é possível? O que estou fazendo errado?

EDIT: eu li sobredesempacotar função, talvez essa função pode me ajudar?

desde já, obrigado

questionAnswers(1)

yourAnswerToTheQuestion