Convert byte array to PDF

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
JNettles
Forum Contributor
Posts: 228
Joined: Mon Oct 05, 2009 4:09 pm

Convert byte array to PDF

Post 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
User avatar
JNettles
Forum Contributor
Posts: 228
Joined: Mon Oct 05, 2009 4:09 pm

Re: Convert byte array to PDF

Post by JNettles »

Nevermind - I was operating under some misinformation. Just dump it into a file using a standard fwrite and it works.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Convert byte array to PDF

Post 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.
Post Reply