Hi, i have a page that i would like to remove all elements that are not of
some colorspace. This is running well to documents with mediabox = cropbox,
but when they are different, the content of e_form is moved. I would like
to maintan elements on original position.

The code to handle e_form is the same of ElementEdit

case Element.e_form: {
   writer.writeElement(element); // write Form XObject reference to current
stream
   Obj form_obj = element.getXObject();
   if (!visited.contains((int) form_obj.getObjNum())) // if this XObject
has not been processed
   {
       // recursively process the Form XObject
       visited.add((int) form_obj.getObjNum());
       ElementWriter new_writer = new ElementWriter();
       reader.formBegin();
       new_writer.begin(form_obj);
       doIt(type, reader, new_writer);
       new_writer.end();
       reader.end();
   }


Any tip will be appreciated. Thanks in advance.

Jef

Reply via email to