Hello,
I think I found a bug in the code handling annotations. In particular,
the SetQuadPoints method throws an error if the annotation type
is not ePdfAnnotation_Highlight. However, according to what I could
find in the pdf spec (section 2.5.6.10: Text Markup Annotations),
the method should work for all Text Markup Annotations, i.e. also for
ePdfAnnotation_Squiggly, ePdfAnnotation_Underline and
ePdfAnnotation_Strikeout. Attached is a patch which modifies the
SetQuadPoints method to check, whether the annotation type is
one of the four Text Markup Annotations.
Best,
Jonathan Verner
Index: src/doc/PdfAnnotation.cpp
===================================================================
--- src/doc/PdfAnnotation.cpp (revision 1455)
+++ src/doc/PdfAnnotation.cpp (working copy)
@@ -276,8 +276,11 @@
void PdfAnnotation::SetQuadPoints( const PdfArray & rQuadPoints )
{
- if ( m_eAnnotation != ePdfAnnotation_Highlight )
- PODOFO_RAISE_ERROR_INFO( ePdfError_InternalLogic, "Must be a highlight annotation to set quad points" );
+ if ( m_eAnnotation != ePdfAnnotation_Highlight &&
+ m_eAnnotation != ePdfAnnotation_Underline &&
+ m_eAnnotation != ePdfAnnotation_Squiggly &&
+ m_eAnnotation != ePdfAnnotation_StrikeOut )
+ PODOFO_RAISE_ERROR_INFO( ePdfError_InternalLogic, "Must be a text markup annotation (hilight, underline, squiggly or strikeout) to set quad points" );
this->GetObject()->GetDictionary().AddKey( "QuadPoints", rQuadPoints );
}
------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been
demonstrated beyond question. Learn why your peers are replacing JEE
containers with lightweight application servers - and what you can gain
from the move. http://p.sf.net/sfu/vmware-sfemails
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users