![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2005
Posts: 4
Rep Power: 0
![]() |
SGML parser
Hi
I am working on a SGML parser converted from MIT(s) SGML parser, the same W3C uses. In the notes from the author it says the following! function htmlline2pixelline() /* The class function returns the current line of the document it is parsing. * It's your responsibility to record the string length and then pack() it's value * using the lower case 'v' flag. Add that value then the hex value '0x0000' * followed by the line data from htmlline2pixelline() to the file holding the * the output, calling $this->sgml_file ( $data ); or if your holding the output * in memory write the data to $this->sgml_stream ( $data ); */ This what I am doing // converts the current HTML line to dec (single pixel color) $data = $this->htmlline2pixelline ( $line[$x] ); // get the line length $len = strlen ( $data ); // add it to the image create data... $this->sgml_stream ( pack ( 'v', $len ) . "0x0000" . pack ( 'v', $data ) ); // So my question is... Does it look like I am doing exactly what the author has said to do. I am wondering because the web page to image conversion does not look very good. example... http://24.218.196.82/snap.gif Notice it is not clear and has the same pattern running through the complete image. The SGML parser is to create a HTML Document tree (outline) of the document URL passed to it. I am trying to extended it so I can create images of webpages using different browsers and their RENDERING, DOM and CSS rules, so one can see what their page looks like in different browsers without the need to install one, doing it with pure PHP and the standard GD lib only! Thanks printf |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Oct 2005
Posts: 4
Rep Power: 0
![]() |
Ok I figured it out. I was packing the $data, when I all I should have been doing was pack() the strings length because the data was already put in format that the webpage image function needed...
I'm A Happy Camper printf |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|