Page 1 of 1

Convert byte array to PDF

Posted: Mon Dec 14, 2009 2:20 pm
by JNettles
I have a PDF byte array that I need to transform back into a PDF file. Has anyone ever done this, or transformed a byte array of anything back into a file using PHP?

My output looks like this right now - just kind of at a loss on how to turn the sucker back into a file.

Code: Select all

object(stdClass)[3]
  public 'getObjResult' => string '%PDF-1.7
%âãÏÓ
 
38 0 obj
<</Linearized 1/L 118188/O 43/E 96704/N 2/T 117308/H [ 2176 488]>>
endobj
               
 
xref
 
38 94
 
0000000016 00000 n
 
0000002664 00000 n
 
0000002756 00000 n
 
0000003206 00000 n
 
........ so on and so forth

Re: Convert byte array to PDF

Posted: Mon Dec 14, 2009 2:44 pm
by JNettles
Nevermind - I was operating under some misinformation. Just dump it into a file using a standard fwrite and it works.

Re: Convert byte array to PDF

Posted: Mon Dec 14, 2009 2:45 pm
by requinix
JNettles wrote:Nevermind - I was operating under some misinformation. Just dump it into a file using a standard fwrite and it works.
Yeah... I was wondering what you might be confused about.