Is it possible to place image to the header only for the first page of the sheet?
We use aspose-cells for java v. 7.2.1 and try to run following:
PageSetup pageSetup = sheet.getPageSetup();
pageSetup.setHeader(2, “&G”);
pageSetup.setHeaderPicture(2, picData);
all works fine, but image appears on all pages.
We also tried with little modification:
PageSetup pageSetup = sheet.getPageSetup();
pageSetup.setHFDiffFirst(true);
pageSetup.setHeader(2, “&G”);
pageSetup.setHeaderPicture(2, picData);
The picture on the first page dissapears, but still presents on others. We’ve failed to find out how to leave the picture on the first page and remove on others.
Also tried to use setFirstPageHeader, but still no effect.
There’s no method something like “setFirstPageHeaderPicture”
I tested your scenario/case and tried to achieve your requirements in MS Excel manually but in vain. I am not sure if this is possible in MS Excel either. Could you please create a sample Excel file manually in MS Excel that should have header picture only in the first page and not on the other pages of the sheet. You may save the Excel file and provide us here, we will check your issue soon. For your information, Aspose.Cells follows MS Excel standards, so if a feature is supported in MS Excel, Aspose.Cells can support it as well, if MS Excel does not support it, Aspose.Cells cannot support it.
I created attached file manualy in MS Excel 2010 (russian edition). You can see image at the right corner of the footer on the first page and no images on other pages. That’s what i really needed.
As my colleague has mentioned, we are unable to manually create a similar file as of yours using MS Excel 2010. Could you please share, what steps did you follow to achieve this? These details would be of great help in analyzing this feature request, and to bring it up on our road map of Aspose.Cells component.
Thank you for providing enough information to properly analyze this requirement on our end. I have logged a ticket in this regard and requested the development team to check the feasibility of the required feature. Ticket Id for your future reference is CELLSJAVA-40628.
We will get back to you as soon as we have any updates.
In order to fulfill your requirement we have added a new method PageSetup.setPicture in our latest version of Aspose.Cells for Java v7.6.0 (download link shared above). Method signature and its usage is provided below,
PageSetup.setPicture(boolean isFirst, boolean isEven, boolean isHeader, int section, byte[] imageData)