uxmstudio / UXMPDFKit

An iOS PDF viewer and annotator written in Swift that can be embedded into any application.
MIT License
275 stars 104 forks source link

PDF Annotation Highlighter and Pen Tool not working #74

Open yhelfronda opened 7 years ago

yhelfronda commented 7 years ago

Hi,

I'm currently using your library on my existing project but I have an issue when using the highlighter and pen. If your using just one finger it doesn't work but when I tried 2 fingers it worked. I don't know what causes this issue. But when I try to use it on new project one finger worked when using pen and highlighter

Here's CG_CONTEXT_SHOW_BACKTRACE:

<Error>: CGContextRestoreGState: invalid context 0x0. Backtrace:
  <_TFC9UXMPDFKit17PDFPathAnnotationW5colorCSo7UIColor+164>
   <_TFC9UXMPDFKit17PDFPathAnnotations5colorCSo7UIColor+152>
    <_TFC9UXMPDFKit24PDFHighlighterAnnotationcfT_S0_+200>
     <_TFC9UXMPDFKit24PDFHighlighterAnnotationCfT_S0_+28>
      <_TTWC9UXMPDFKit17PDFPathAnnotationS_13PDFAnnotationS_FS1_CfT_x+24>
       <_TFC9UXMPDFKit23PDFAnnotationControllerP33_5512D3F841EECEA3D762B93CDA4482EC19createNewAnnotationfT_T_+168>
        <_TFC9UXMPDFKit23PDFAnnotationController12touchesBeganfTGVs3SetCSo7UITouch_4withGSqCSo7UIEvent__T_+832>
         <_TToFC9UXMPDFKit23PDFAnnotationController12touchesBeganfTGVs3SetCSo7UITouch_4withGSqCSo7UIEvent__T_+116>
          <<redacted>+336>
           <<redacted>+60>
            <<redacted>+1948>
             <<redacted>+3192>
              <<redacted>+340>
               <<redacted>+2400>
                <<redacted>+4268>
                 <<redacted>+148>
                  <<redacted>+24>
                   <<redacted>+540>
                    <<redacted>+744>
                     <CFRunLoopRunSpecific+424>
                      <GSEventRunModal+100>
                       <UIApplicationMain+208>
                        <main+76>

Environment

scottcc commented 6 years ago

I have this feeling you may not be understanding how the toolbar UI seems to be built - if you use the default tools, touching the "Pen" expands it to allow you to choose between Pen and Highlighter. You have to pick one of those, then it will work.

There is a separate issue that while signing, two-finger touches will both zoom the page and start drawing a new annotation from the first finger (less good). But, that's a separate thing.