Practical PHP Programming:Multimedia
From IpbWiki
If you have previously only used PHP to work with HTML content, it will come as a nice surprise that working with multimedia content uses almost exactly the same process. It seems that many people just don't realise that PHP is capable of handling much more than non-HTML data, and hopefully this chapter will help shed a great deal of light on this exciting and challenging topic.
Through its extensions, PHP is able to easily handle creating image data in a variety of formats, generating Flash movies, and even generating PDFs - each have their own advantages and disadvantages, and are all in popular use. Having the ability to create custom multimedia content on the fly is very powerful indeed - although outputting content to HTML can do a lot, a picture says a thousand words! For example, by generating multimedia content, we can create dynamic weather forecasts, or user-customised PDFs - the possibilities are endless.
Note that in order to work with multimedia, you must first understand that each type of content, whether it be images, Flash, or PDF, all have their own unique file formats that need to be absolutely precise - you must be careful not to use any text in your multimedia PHP scripts, not even extra blank lines before or after your <?php and ?> tags. The RTF format allows text formatting to be contained using special text encoding characters, and therefore can be manipulated using simple string routines.
Topics covered in this chapter are:
- The multimedia formats that are available and their advantages
- Creating basic image formats
- Working with the rich-text format (RTF)
- Creating portable document format (PDF) files
- Working with the Shockwave Flash (SWF) format
Chapter contents
- 10.1. Practical_PHP_Programming:Brief history of web media
- 10.1.1. Practical_PHP_Programming:GIF files
- 10.1.2. Practical_PHP_Programming:PNG files
- 10.1.3. Practical_PHP_Programming:JPEG files
- 10.1.4. Practical_PHP_Programming:RTF files
- 10.1.5. Practical_PHP_Programming:PDF files
- 10.1.6. Practical_PHP_Programming:Flash movies
- 10.1.7. Practical_PHP_Programming:SVG files
- 10.2. Practical_PHP_Programming:How to output images from PHP
- 10.2.1. Practical_PHP_Programming:Creating new images
- 10.2.2. Practical_PHP_Programming:Choosing a picture format
- 10.2.3. Practical_PHP_Programming:Drawing a filled rectangle
- 10.2.4. Practical_PHP_Programming:True-colour images and more shapes
- 10.2.5. Practical_PHP_Programming:Drawing polygons
- 10.2.6. Practical_PHP_Programming:Outputting text
- 10.2.7. Practical_PHP_Programming:Working with existing images
- 10.2.8. Practical_PHP_Programming:Colour and image fills
- 10.2.9. Practical_PHP_Programming:Setting a transparent colour
- 10.2.10. Practical_PHP_Programming:Using brushes
- 10.2.11. Practical_PHP_Programming:Basic image copying
- 10.2.12. Practical_PHP_Programming:Scaling and rotating images
- 10.2.13. Practical_PHP_Programming:Drawing points and lines
- 10.2.14. Practical_PHP_Programming:Updating our drawing script
- 10.2.15. Practical_PHP_Programming:Using prebuilt special effects
- 10.2.16. Practical_PHP_Programming:Introduction to hand-coded special effects
- 10.2.17. Practical_PHP_Programming:Special effects: colour reduction
- 10.2.18. Practical_PHP_Programming:Special effects: interlacing
- 10.2.19. Practical_PHP_Programming:Special effects: screen
- 10.2.20. Practical_PHP_Programming:Special effects: greyscale
- 10.2.21. Practical_PHP_Programming:Special effects: duotone
- 10.2.22. Practical_PHP_Programming:Special effects: noise
- 10.2.23. Practical_PHP_Programming:Special effects: scatter
- 10.2.24. Practical_PHP_Programming:Special effects: pixellate
- 10.2.25. Practical_PHP_Programming:Special effects: blur
- 10.2.26. Practical_PHP_Programming:Interlacing an image
- 10.2.27. Practical_PHP_Programming:Getting an image's MIME type
- 10.2.28. Practical_PHP_Programming:Keeping your filesizes small
- 10.2.29. Practical_PHP_Programming:Drawing graphs
- 10.3. Practical_PHP_Programming:Working with RTF files
- 10.4. Practical_PHP_Programming:Creating PDF documents
- 10.4.1. Practical_PHP_Programming:There's more than one way to make PDFs
- 10.4.2. Practical_PHP_Programming:Creating a PDF with PHP
- 10.4.3. Practical_PHP_Programming:Adding more pages and styles
- 10.4.4. Practical_PHP_Programming:Adding images to PDFs
- 10.4.5. Practical_PHP_Programming:PDF special effects
- 10.4.6. Practical_PHP_Programming:Adding PDF document data
- 10.4.7. Practical_PHP_Programming:Point sizes in real life
- 10.4.8. Practical_PHP_Programming:ClipPDF interoperability
- 10.5. Practical_PHP_Programming:Creating Flash movies
