[]
Use this object to configure the content shown in a specific header or footer section, such as the center header on the first printed page.
IPageSetup pageSetup = worksheet.getPageSetup();
pageSetup.setDifferentFirstPageHeaderFooter(true);
IHeaderFooter centerHeader = pageSetup.getFirstPage().getCenterHeader();
centerHeader.setText("&G");
IGraphic picture = centerHeader.getPicture();
try (InputStream stream = createSampleImageStream()) {
picture.setGraphicStream(stream, ImageType.PNG);
}
Use this method to retrieve the string currently configured for a page header or footer section.
IPageSetup pageSetup = worksheet.getPageSetup();
pageSetup.setDifferentFirstPageHeaderFooter(true);
IHeaderFooter centerHeader = pageSetup.getFirstPage().getCenterHeader();
centerHeader.setText("Confidential");
String text = centerHeader.getText();
Use this method to configure the string printed in a page header or footer section.
IPageSetup pageSetup = worksheet.getPageSetup();
pageSetup.setDifferentFirstPageHeaderFooter(true);
IHeaderFooter centerHeader = pageSetup.getFirstPage().getCenterHeader();
centerHeader.setText("Confidential");
value - The text included in the specified header or footer section.IGraphic object that represents a picture field included in the specified header or footer section. Use the returned object to configure the picture shown in this header or footer section.
IPageSetup pageSetup = worksheet.getPageSetup();
pageSetup.setDifferentFirstPageHeaderFooter(true);
IHeaderFooter centerHeader = pageSetup.getFirstPage().getCenterHeader();
centerHeader.setText("&G");
IGraphic picture = centerHeader.getPicture();
try (InputStream stream = createSampleImageStream()) {
picture.setGraphicStream(stream, ImageType.PNG);
}
IGraphic object that represents the picture field in the header or footer section.