title: Extract Checkbox value out of PDF 1.7 using PDFBox
body: <p>I have recently started working with pdfbox to extract text out of pdf. Though along with text I also need to extract checkbox value show in image. I have tried different methods to find the checkbox element and extract its values.</p>
  <p><a href="https://i.stack.imgur.com/QaKUJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QaKUJ.png" alt="Checkboximage" /></a></p>
  <p>After researching the pdf text through <a href="https://github.com/itext/rups/releases" rel="nofollow noreferrer">this tool</a> I found that the checkbox is not image or anything but some kind of graphics represented by below content.</p>
  <pre><code>ET
  Q
  q
  BT
  /F2 6 Tf
  481.3 653.29 Td
  (  ) Tj
  ET
  Q
  q
  1 1 1 rg
  484.3 653.29 9 9 re
  f
  Q
  q
  0.87059 0.87059 0.87059 rg
  485.05 661.54 m
  492.55 661.54 l
  493.3 662.29 l
  484.3 662.29 l
  485.05 661.54 l
  f
  Q
  q
  0.87059 0.87059 0.87059 rg
  492.55 661.54 m
  492.55 654.04 l
  493.3 653.29 l
  493.3 662.29 l
  492.55 661.54 l
  f
  Q
  q
  0.87059 0.87059 0.87059 rg
  492.55 654.04 m
  485.05 654.04 l
  484.3 653.29 l
  493.3 653.29 l
  492.55 654.04 l
  f
  Q
  q
  0.87059 0.87059 0.87059 rg
  485.05 654.04 m
  485.05 661.54 l
  484.3 662.29 l
  484.3 653.29 l
  485.05 654.04 l
  f
  Q
  q
  BT
  /F2 6 Tf
  495.55 653.29 Td
  (Yes) Tj
  ET
  Q
  q
  BT
  /F2 6 Tf
  504.88 653.29 Td
  (  ) Tj
  ET
  Q
  q
  1 1 1 rg
  507.88 653.29 9 9 re
  f
  Q
  q
  0.87059 0.87059 0.87059 rg
  508.63 661.54 m
  516.13 661.54 l
  516.88 662.29 l
  507.88 662.29 l
  508.63 661.54 l
  f
  Q
  q
  0.87059 0.87059 0.87059 rg
  516.13 661.54 m
  516.13 654.04 l
  516.88 653.29 l
  516.88 662.29 l
  516.13 661.54 l
  f
  Q
  q
  0.87059 0.87059 0.87059 rg
  516.13 654.04 m
  508.63 654.04 l
  507.88 653.29 l
  516.88 653.29 l
  516.13 654.04 l
  f
  Q
  q
  0.87059 0.87059 0.87059 rg
  508.63 654.04 m
  508.63 661.54 l
  507.88 662.29 l
  507.88 653.29 l
  508.63 654.04 l
  f
  Q
  q
  BT
  /F2 6 Tf
  519.13 653.29 Td
  (No) Tj
  ET
  Q
  q
  BT
  /F2 6 Tf
  36.75 642.95 Td
  </code></pre>
  <p>I am not sure how to extract this out of pdf, I have seen different parser provided by pdfbox but it looks like I need to have more information about how pdf is constructed. Any pointers would be much more appreciated.</p>