How to get chart image with and height

Hi Team,

My requiremnet is to get height and width of chart image embedded in pdf. it will show index should in the range.
i have enclosed the sample input .Thanks in advance. (22.3 KB)


priyanga G


Thanks for your inquiry. Please note we have an API Aspose.Pdf to manipulate PDF documents. Please check following documentation for details. Hopefully it will help you to accomplish the task.

Working with ImagePlacement (Aspose.Pdf)

Hi @tilal.ahmad,

Thank you very much for timely reply.

i need that solution in aspose in java.

kind regards,

We have tested your PDF document with the latest version 17.6 of Aspose.Pdf for Java API and unable to retrieve the width and height of the chart image. It has been logged under the ticket ID PDFJAVA-36954 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates. We are sorry for the inconvenience caused.

Please refer to this help topic: Add, Delete and Extract Images from the PDF file

Best Regards,
Imran Rafique

Hi @imran.rafique

Thanks a lot.

Thanks & regards,
priyanga G


Thanks for your patience.

We have further investigated the earlier logged issue and it was found that in this document (page19_Fig_12.pdf) there are no pictures, the chart consists of lines and text, and it is not unified into a single object. So you can only take the page size in this case.

// Load the contents of first page
Page p = doc.getPages().get_Item(1);
System.out.println("chart width:" + p.getCropBox().getWidth());
System.out.println("chart height:" + p.getCropBox().getHeight());

In case of any further assistance, please feel free to let us know.

Hi @asad.ali,

Thank you very much for providing a solution.

priyanga G