title: How to match pdf coordinates when page is rotate?
body: <p>Input Page- <a href="https://drive.google.com/file/d/1L96VnNYkHUMaix3304HatLmxBEn5TXzy/view?usp=sharing" rel="nofollow noreferrer">Page is rotate by 90 degrees</a></p>
  <p>I have Bbox coordinates of pdf :
  &quot;bbox&quot;: [
  30.011541726705907,
  75.71827220651915,
  579.5308781816717,
  708.1347981631202
  ]
  as <a href="https://i.stack.imgur.com/SlWFN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SlWFN.png" alt="shown" /></a>.</p>
  <p>Whenever I trying to tag these coordinates, I'm unable to tag as shown in the figure because of 90 degrees rotation.</p>
  <p>&quot;tag these coordinates:- I want to make the particular coordinates content accessible.</p>
  <pre><code>private void tag(PDDocument inputfile, int curTD_s, int curTD_e,List&lt;Float&gt; Bbox) {
  /*curTD_s and curTD_e:Transformed position of perticular TD,td operator
     Bbox  :- The content coordinated which needs to be tagged(accessible)*/
      //Loading an existing document
      File file = new File(&quot;C:/PdfBox_Examples/sample.pdf&quot;);
      PDDocument document = PDDocument.load(file);
  
      PDPage pg = document.getPage(0);
      PDFStreamParser parser = new PDFStreamParser(pg);
      parser.parse();
      List&lt;Object&gt; tokens = PDFUtils.removeTokens(parser.getTokens());
      for (int index = 0; index &lt; tokens.size(); index++){
  
          if(Bbox.get(0)&lt;= curTD_s &amp;&amp;
                  Bbox.get(1) &lt;= curTD_e &amp;&amp;
                  curTD_s &lt;= Bbox.get(2) &amp;&amp;
                          curTD_e &lt;= Bbox.get(3)){
              tokens = addtaggingtokens(tokens, index); //tagging all Tj's which falls under my given BBox
          }
          curTD_s, curTD_e = gettransformationmatrix(index, tokens); // Transformed the actuall matrix, it will return starting postion of Tj's.
      }
      //Saving the document
      document.save(&quot;C:/PdfBox_Examples/sample.pdf&quot;);
      //Closing the document
      document.close();
  
  }
  </code></pre>
  <p>Tagged images show like-<a href="https://i.stack.imgur.com/csM2Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/csM2Q.png" alt="tagged " /></a></p>
  <p>Tagged Page without rotation- <a href="https://drive.google.com/drive/folders/1Qs-9vtU7Hotg820FafADZZfQk8yBe_sc?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/drive/folders/1Qs-9vtU7Hotg820FafADZZfQk8yBe_sc?usp=sharing</a>  (This link includes Input PDF,BBox,output pdf)</p>
  <p>Tagged Page with rotation:- <a href="https://drive.google.com/drive/folders/1GlhlaVbnOpwxYF6MIQAmsLrt64urzFHB?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/drive/folders/1GlhlaVbnOpwxYF6MIQAmsLrt64urzFHB?usp=sharing</a> (This link includes Input PDF,BBox,output pdf)</p>