Detecting PDF overprint / blend

Q:

We need, using PHP version of the lib, to determine when blend of overprint is present on a PDF page. The PHP code must be here: (we try getFillOverprint() getOverprintMode() getStrokeOverprint() and nothing :(( )

$itr = $doc->GetPageIterator();

while ($itr->HasNext())

{

$page = $itr->Current();

$reader->Begin($page);

while (($element = $reader->Next()) != null)

if($element->GetType()==Element::e_text

$element->GetType()==Element::e_text

$element->GetType()==Element::e_text_new_line

$element->GetType()==Element::e_text_begin

$element->GetType()==Element::e_text_end

){

$gs = $element->GetGState();

if($gs->GetTextRenderMode()==GState::e_clip_text){ // <Otros estados de clip… verificar también…

if($page->getIndex()==1)

break;

$arrPagConTextClipping[$indicePagConTextClipping++] = $page->getIndex();

break;

}

}

$reader->End();

$itr->Next();

}

We attached the PDF page with problem to this post. Is from the original PDF reference, the last page. Is about “blending” and “overprint”.

A:

The problem is that the attached file (PDF Spec Appendix) does not contain text overprint. Actually overprint and transparencies are flattened.

To detect overprint you could use getFillOverprint() getOverprintMode() getStrokeOverprint() – the only caveat is that you would also need to recursively process XForms objects (as shown in ElementReader sample) and you may also need to check pattern content streams (since these could be used as a fill color) …