Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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

Posted on 2004-10-29
Medium Priority
Last Modified: 2009-12-21

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.:


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.
Question by:phpamble
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 48

Accepted Solution

hernst42 earned 1400 total points
ID: 12447021
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);

Author Comment

ID: 12480064

Thank you very much for your excellent assistance.  I also increased the point value for this question.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question