title: Apache POI - watermark in Excel - different appearence in Excel and LibreOffice
body: <p>I follow the <a href="https://www.programmersought.com/article/86016100239/" rel="nofollow noreferrer">sample</a> and add pictures as watermark like the following:</p>
  <pre><code>private void addWaterMark4AllSheets() {
      final BufferedImage image = FontImage.createWatermarkImage();
      // Export to byte stream B
      final ByteArrayOutputStream os = new ByteArrayOutputStream();
      try {
          ImageIO.write(image, &quot;png&quot;, os);
      } catch (final IOException e) {
          e.printStackTrace();
      }
  
      final XSSFWorkbook wb = (XSSFWorkbook) workBook;
      final int pictureIdx = wb.addPicture(os.toByteArray(), Workbook.PICTURE_TYPE_PNG);
      final POIXMLDocumentPart poixmlDocumentPart = wb.getAllPictures().get(pictureIdx);
      // ((XSSFSheet )(schreiben.getSheet()).
      for (int i = 0; i &lt; workBook.getNumberOfSheets(); i++) {// Get each Sheet
          final XSSFSheet sheet = wb.getSheetAt(i);
          final PackagePartName ppn = poixmlDocumentPart.getPackagePart().getPartName();
          final String relType = XSSFRelation.IMAGES.getRelation();
          // add relation from sheet to the picture data
          final PackageRelationship pr = sheet.getPackagePart().addRelationship(ppn, TargetMode.INTERNAL, relType,
                  null);
          // set background picture to sheet
          sheet.getCTWorksheet().addNewPicture().setId(pr.getId());
      }
  
  } 
  </code></pre>
  <p>In general the approach works quite fine. A picture is added into the Excel. But the appearance is different.</p>
  <ol>
  <li>In Excel: the image is displayed in the background during the editing (of the sheets). But it is NOT displayed when I print the sheet.</li>
  <li>In LibreOffice (7.1): the image is NOT displayed during the editing (of the sheet) - but is printed.</li>
  </ol>
  <p>Is there a chance to fix it for working in both Spreadsheets?</p>