We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Embedding Excel in the OLE- Worksheet resize issue

Hi,
When I was seraching for a solution for Worksheet resize issues on OLE object in PPTX, I came across the following link.

http://www.aspose.com/docs/display/slidesjava/Working+Solution+for+Worksheet+Resizing

Can you kindly help to confirm which version of aspose slides jar would this fix be applicable on.
FYI I have been working with aspose.slides-15.7.0 and the constructor for Picture class is not available as used in the code on the above mentioned link.

Picture pic = new Picture(presentation, iStream);
int picId = presentation.getPictures().add(pic);

Kindly confirm the Aspose Slides jar version , this fix will be working on.

Thanks,
Prabu R

Hi Prabu R,


Thank you for creating a separate thread for your issue.

I have observed your comments and like to request you to please try using following lines of code on our end, to add a picture to the presentation. I request you to please try using Aspose.Slides for Java 15.11.0 on your end.

IPPImage imgx = null;
try
{
imgx = pres.getImages().addImage(new FileInputStream(new File(“C:\pdf.png”)));
}

Please let us know if the issue persists. We will be happy to assist you further.

Best Regards,

Dear Adnan Ahmad,

Could you please replace the below code with the link which I have provided.We are getting difficulty to execute the code.

public void exportPPTX(OutputStream outputStream)
throws Exception
{
Worksheet worksheet = getWorkbookDesigner().getWorkbook().getWorksheets().get(SHEET_NAME_CHART);
worksheet.getPageSetup().setLeftMargin(0.0);
worksheet.getPageSetup().setRightMargin(0.0);
worksheet.getPageSetup().setTopMargin(0.0);
worksheet.getPageSetup().setBottomMargin(0.0);

/***************Create Image START *****************************************************/
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.setVerticalResolution(300);
imgOptions.setHorizontalResolution(300);
imgOptions.setOnePagePerSheet(true);
imgOptions.setImageFormat(ImageFormat.getPng());
SheetRender sr = new SheetRender(worksheet, imgOptions);
ByteArrayOutputStream imageStream = new ByteArrayOutputStream();
sr.toImage(0, imageStream);
byte[] imageByteArray = imageStream.toByteArray();
/***************Create Image END *******************************************************/

/***************Create Presentation START *****************************************************/
Presentation pres = new Presentation();
ISlide sld = pres.getSlides().get_Item(0);
IPPImage imgx1 =null;
imgx1 = pres.getImages().addImage(imageByteArray);
IPictureFrame pf1=sld.getShapes().addPictureFrame(ShapeType.Rectangle, 0, 0, imgx1.getWidth(), imgx1.getHeight(), imgx1);
//Setting relative scale width and height

float imgHeightInInches = imgx1.getHeight() / 95.99f;
float imgWidthInInches = imgx1.getWidth() / 95.99f;
float heightScale = 7.5f / imgHeightInInches;
float widthScale = 10f / imgWidthInInches;
pf1.setRelativeScaleHeight(heightScale);
pf1.setRelativeScaleWidth(widthScale);
/***************Create Presentation END *****************************************************/
pres.save(outputStream, 3);
}

http://www.aspose.com/docs/display/slidesjava/Working+Solution+for+Worksheet+Resizing

Or else could you please provide the execeuctable code for worksheet resizing issue.

Thanks
Prabu R

Dear Adnan Ahmad,

Could you please rewrite the code in the below link using latest jar file. Since we are facing issue while executing the code in the below link. Could you send the full code which should be executed without issue.

http://www.aspose.com/docs/display/slidesjava/Working+Solution+for+Worksheet+Resizing

Thanks
Prabu R

Hi Prabu R,


I have observed your comments and have worked as per your requirements. I would like to share with you that the article Working solution for Worksheet re-sizing was a workaround solution which is not working anymore because of some internal changes to Aspose.Cells and Aspose.Slides APIs. As you know, the same issue is logged with ID SLIDESJAVA-35041 into our issue management system. We understand your concerns and we request you to be patient, and to spare us some time until the issue is resolved. We will notify you as soon as the issue will be fixed.

We are sorry for your inconvenience,