Solved
How to get page size information.
Hi All,
I am trying to get page size information in AEM, but cannot locate it. Can you tell from where I can get this information.
Thank you.
Hi All,
I am trying to get page size information in AEM, but cannot locate it. Can you tell from where I can get this information.
Thank you.
Hi @muskan_mala ,
You can get the page size from input stream as belows.
public long getPageSize(Page page) {
Resource contentResource = page.getContentResource();
InputStream contentStream = contentResource.adaptTo(InputStream.class);
return contentStream != null ? contentStream.available() : 0;
}
Here, getPageSize() method takes a AEM Page object as its argument, and returns the size of the page's content in bytes.
Hope this could help you!
Regards
Shiv
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.