Aspose.Slides: renderToGraphics Method Is Not Rendering to Scale

Hello,

We are currently evaluating your products in order to integrate into our produce for different document formats .

In Aspose Words a method RenderToScale exists which can be used to render to System.Drawing.Graphics.

This is very convenient for rendering to our graphics object.

Unfortunately, your Slides lack this functionality.

Is it not possible to render to a Graphics context?

Could you add this functionality in a future release?

@mirnalini,
Thank you for contacting support.

If I understand correctly, you mean the RenderToScale method that renders a document page into a Graphics object with a specified scale.

Please note:

  1. You are using Aspose.Slides for Java but the System.Drawing.Graphics class is a part of .NET, and it’s a little confusing. Could you kindly clarify your requirements in more detail?
  2. The ISlide interface already contains the following method:
    void renderToGraphics(IRenderingOptions options, Graphics2D graphics, 
                          float scaleX, float scaleY)

You can use it to render presentation slides into Graphics2D objects with a specified scale.

Yes I went through the rendertoGraphics method mentioned above.
But when we use that method, we see slide output being chopped off when rendered into our graphics object passed in our code.

We get correct output when we use ImageIO.write or graphics.drawImage.

We see that aspose words provides the below method(getSizeinPixels) with which we are able to render to the same graphics object perfectly for word documents.

Dimension thumbSize = doc.getPageInfo(pageNum - 1).getSizeInPixels(zoomLevel, 72);
int imgWidth = (int) (thumbSize.getWidth());
int imgHeight = (int) (thumbSize.getHeight());
doc.renderToSize(pageNum - 1, gr, 0, 0, imgWidth, imgHeight);

We want to know the equivalent method for aspose slides to work for presentation documents.

@mirnalini,

Yes, you described the issue in How to Set DPI for Slides when Rendering Them to Graphics2D in Java?. Please do not duplicate topics on the forum in the future. Unfortunately, you did not provide the sample standalone project to reproduce the problem on our end. We would really like to help you and are sorry that you have had to deal with this problem, but we do not have enough information to do so.