Can someone please help regarding
"How to Read Headers and Footers using API way easily"
Currently one will have to parse very care fully using String/Substring and other operations to get the actual values which involved lot of parsing of the contents just for reading the Header and footer values along with its styling information.
Hi,
Thank you for using Aspose.Cells for Java.
You can use the Page Setup’s getHeader/getFooter methods for getting he header information. These methods get the section number as input. So, you can easily acquire your desired information by providing appropriate section number.
Please provide us your sample source excel file with your elaborated requirements if the above information doesn’t meet your requirements.
Hi,
Thanks for your posting and using Aspose.Cells for Java.
You can retrieve the headers/footers informating using PageSetup.getHeader() and PageSetup.getFooter() methods.
Please see the following documentation article for more help regarding header/footer sections.
Thanks for reply,
Please look at following three variants of headers Strings having text as “center header” and help us to find a programmatic way to get the each property and text value using ASPOSE API
1: &C&“Aharoni,Bold Italic”&12&KFF0000center header
2: &Rcenter heder
3: &L&"-,Bold"&14center header
Hi,
Thanks for your posting.
It’s good to know that you can now extract the Header/Footer information, now you will have to tokenize the information using String.Split() method.
Please remember, each token starts from & symbol.
Here &C means Central Section, &12 is a Font Size, &K is a Font Color and center header is your text. Also the central section font is "Aharoni,Bold Italic"
Similarly, &R is a Right Section and center header is your text.
And likewise, &L is a Left Section, &14 is a Font Size and center header is your text.
Hi,
Thank you for using Aspose.Cells.
After going through the API documentation, it seems there is no such method available that can extract the Header/Footer text from a worksheet, and you will have to parse it manually for retrieving your text.
I have forwarded your requirements to our development team for investigate if implementation of such an API method is possible in near future or not. We will let you know here once we have an update from the development team about this.
The issue has been logged in our Issue Tracking System as: CELLSJAVA-40255.
Let say i get two variants like
&KFF0000center header
&12center header
How would i separate Header Text using substring? There can be anything before the actual text?
Wouldnt it be nice if API can separate the header text with & as well so that we can perform split on & character and get the required text from last index of the split result?
azeemyousaf:
Let say i get two variants like
&KFF0000center header
&12center header
How would i separate Header Text using substring? There can be anything before the actual text?
Wouldnt it be nice if API can separate the header text with & as well so that we can perform split on & character and get the required text from last index of the split result?
Hi,
Thanks for your feedback.
This is a valid point, we will soon look into it and let you know our findings.
We have logged your comments in our database against the issue id: CELLSJAVA-40255.
As this is blocking us to provide a main functionality to our customers, please look if there can be a quick update on this change.
Further enhancements can be done in planned release, but it will be highly appreciated if we can get a quick fixed library for this
Hi Azeem,
Thank you for using Aspose.Cells.
We understand your concerns in this regard and will update you here once we have any information from our development team regarding this.
I would also like to share with you that the implementation of any new feature depends the amount of complexity involved and the priority of the issue. We will let you know when works starts on this issue and will provide ETA then from our Issue Tracking System.
Hi,
Thanks for using Aspose.Cells for Java
Please download and try this fix: Aspose.Cells for Java (Latest Version)
We have provided some new APIs to get the parsed section for header/footer.
Please see the following sample code:
Java
pagesetup.setHeader(0, “&KFF0000center header”);
HeaderFooterCommand[] cmds = pagesetup.getCommands(pagesetup.getHeader(0));
System.out.println(cmds[0].getType()); //HeaderFooterCommandType.TEXT
System.out.println(cmds[0].getFont().getColor());
System.out.println(cmds[0].getText());
The issues you have found earlier (filed as CELLSJAVA-40255) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.