Black rectangles e_path type that is not in the original PDF

Hello!
Your tools are great! Sure I am doing somethig wrong.

Please see this image: https://docs.google.com/open?id=0B-gaXnIQcdayNWZkMTE2M2UtZGYwMy00ZDRiLWIzMmQtNjRhNDQ2ODViZDM4

The original PDF do not have those black rectangles. I recreate the
PDF using Element like this:

                        case Element::e_path:
                        {
                                echo "some black e_path here :(";
                                $writer->WriteElement($element);
                                break;
                        }

                        case Element::e_image:
                        case Element::e_inline_image:
                        case Element::e_shading:
                        case Element::e_null:
                        case Element::e_group_begin:
                        case Element::e_group_end:
                        case Element::e_marked_content_begin:
                        case Element::e_marked_content_end:
                        case Element::e_marked_content_point:
                        {
                                $writer->WriteElement($element);
                                break;
                        }
                        case Element::e_form:
                        {
                                $reader->FormBegin();
                                ProcessElementsSinTexto($reader,
$writer);
                                $reader->End();
                                break;
                        }

                        default:
                                continue;

Thank you in advance!
Carlos

PS: those path have some kind of disable property that I must read? or
alpha?
PS2: I note that those black renctangles are near to text when an
image is close.

You can identify clipping paths, when processing, as follows:

case Element::e_path:

if (element->IsClipPath())

Futhermore, you could skip output of clipping paths when their bbox (element->GetBBox()) signitifanctly overlaps with the text bbox?

Alternatively you could try to delete (i.e. skip) child elements in a clip (until you hit Element::e_group_end) and set path fill to false.

These are just some ideas.