Why is my strikethrough annotation so thin?

47 views
Skip to first unread message

Aaron

unread,
May 29, 2014, 7:13:21 PM5/29/14
to pdfne...@googlegroups.com
Q:

I'm importing an XFDF annotation with PDFNet and then viewing the result in Acrobat.  The XFDF annotation is a strike-through annotation:

<strikeout style="solid" width="2" color="#000000" opacity="1" creationdate="D:20140514154049Z00'00'"
flags="print" date="D:20140514154049Z00'00'" page="0"
coords="58.520150,625.036788,166.436681,625.036788,58.520150,632.66780,166.436681,632.6678022" rect="58.520150,625.036788,166.436681,632.667802">
<contents>Text</contents>
</strikeout>


The "width" is 2, but still the line is thin.  Why?

A:

To apply the thickness, you will need to call RefreshAppearance on the annotation.  This call makes PDFNet create the appearance of the Annotation, rather than Acrobat (which creates thin lines for underline and strikethrough, even if you create them in the Acrobat viewer.)

The code would look something like:

Dim itr As PageIterator = doc.GetPageIterator()
While itr.HasNext()  '  Read every page
    Dim page As Page = itr.Current()
    Dim num_annots As Integer = page.GetNumAnnots()
    Dim i As Integer = 0
    While i < num_annots
        Dim ann As Annot = page.GetAnnot(i)
        If ann.IsValid() Then
            ann.RefreshAppearance()
        End If
        i = i + 1
    End While
    itr.Next()
End While



Reply all
Reply to author
Forward
0 new messages