Write An Image Created By A Charting Class To A Bitmap File

Hi

I have a barchart created by the chartdirector program available as a stream of bits that I then print using the print php statement, viz.:

print($c->makeChart2(PNG));

With the makechartChart2 being the operation of the barcharting class.

I do not have the GD graphics library loaded but need to find some way to save the stream of bits as a file so that I can later make it available to a class (part of the fpdf library) that can insert the image as a picture in a pdf document.

Does anybody have a solution.?

Help would be appreciated.
Thanks
phpamble
LVL 1
phpambleAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hernst42Commented:
If you print the content, why not just saving the content to a variable like this:
$pic = $c->makeChart2(PNG);

// output bits
print $pic;

//write pic to file:
$fp = fopen('/name/of/pic.png', 'w+');
fputs($fp, $pic);
fclose($fp);
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
phpambleAuthor Commented:
hernst42

Thank you very much for your excellent assistance.  I also increased the point value for this question.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.