title: pdfbox - sign landscape file error
body: <p>I am using <strong>pdfbox-1.8.8</strong> to do the signing function on PDF file.</p>
  
  <p>It works well with PDF file in portrait mode. But with landscape file, I have an issue</p>
  
  <p><a href="https://i.stack.imgur.com/iYDi9.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iYDi9.jpg" alt="Position of signatory I want to sign"></a></p>
  
  <p><a href="https://i.stack.imgur.com/wyPC4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wyPC4.jpg" alt="Result of the sign"></a></p>
  
  <p>It looks like the coordinate is wrong for the landscape file.</p>
  
  <p>Does anyone know what is wrong with the file ?</p>
  
  <p>Here is the link of <a href="https://drive.google.com/file/d/0BwLd99D2Ui9VQnFoV0c4b3Yyd2c/view?usp=sharing" rel="nofollow noreferrer">pdf file</a></p>
  
  <p>Here is the code I used to sign</p>
  
  <pre><code>public void signDetached(String inputFilePath, String outputFilePath, String signatureImagePath, Sign signProperties) {
      OutputStream outputStream = null;
      InputStream inputStream = null;
      PDDocument document = null;
      InputStream signImageStream = null;
  
      try {
          setTsaClient(null);
          document = PDDocument.load(inputFilePath);
          // create signature dictionary
          PDSignature signature = new PDSignature();
          signature.setFilter(PDSignature.FILTER_ADOBE_PPKLITE);
          signature.setSubFilter(PDSignature.SUBFILTER_ADBE_PKCS7_DETACHED);
          signature.setName("VANDUC1102");
          signature.setLocation(null);
          String displayName = "Hello World, Document signed by VANDUC1102";
          String reason = reasonText+ " " + displayName;
          signature.setReason(reason);
  
          // the signing date, needed for valid signature
          signature.setSignDate(Calendar.getInstance());            
          int signatureInPage = signProperties.getPageNumber() + 1;
          signImageStream = new FileInputStream(new File(signatureImagePath));
          PDVisibleSignDesigner visibleSig = new PDVisibleSignDesigner(inputFilePath, signImageStream, signatureInPage);
  
          float xAxis = convertPixel2Point(signProperties.getX()) ;
          float yAxis = convertPixel2Point(signProperties.getY());               
          float signImageHeight = convertPixel2Point(signImageHeight);    
          float signImageWidth = convertPixel2Point(signImageWidth);
  
          visibleSig.xAxis(xAxis)
                  .yAxis(yAxis)
                  .zoom(0)
                  .signatureFieldName("Signature")
                  .height(signImageHeight)
                  .width(signImageWidth);
          PDVisibleSigProperties signatureProperties = new PDVisibleSigProperties();
  
          signatureProperties.signerName(eiUser.getName())
                   .signerLocation(null)
                   .signatureReason(reason)
                   .preferredSize(0)
                   .page(signProperties.getPageNumber())
                   .visualSignEnabled(true)
                   .setPdVisibleSignature(visibleSig)
                   .buildSignature();
           // register signature dictionary and sign interface
          SignatureOptions signatureOptions = new SignatureOptions();
          signatureOptions.setVisualSignature(signatureProperties);
          signatureOptions.setPage(signatureInPage);
          document.addSignature(signature, this, signatureOptions);
  
          File outputFile = new File(outputFilePath);
          outputStream = new FileOutputStream(outputFile);
          inputStream = new FileInputStream(inputFilePath);
          IOUtils.copyStream(inputStream, outputStream);
          document.saveIncremental(inputStream, outputStream);
          outputStream.flush();
      } catch (COSVisitorException | SignatureException | IOException ex) {
          log.error("signDetached ", ex);
      } finally {
          IOUtils.closeStream(outputStream);
          IOUtils.closeStream(inputStream);
          IOUtils.closeStream(signImageStream);
          IOUtils.closeStream(document);
      }
  }
  private float convertPixel2Point(float pixel){
      return pixel * (float) 72/96;
  }
  </code></pre>
  
  <p>As I said this code work well with portrait PDF</p>
  
  <p>Thanks.</p>