Render embedded charts in Word and Excel documents to Image with Aspose Cloud APIs

Are there cloud API parameters for setting the scaling, resolution, and/or pixel dimensions of cloud-rendered DrawingML (to PNG, JPEG, etc.)?

Hi Brian,


Thank you for contacting support. Please elaborate a bit more about the use case like which Aspose API are you using to access cloud-rendered DrawingML? Please also give us the source document and example code. We’ll investigate and reply you appropriately.

Hello,

I am evaluating Aspose Cloud for a proposal. I just discovered your offerings last Thursday. Thus, I can provide neither code nor source documents. The use case is rendering embedded charts in Word and Excel documents. (I now understand that DrawingML is lumped with VML under Shapes.)

I have not [yet] been able to find a rendering parameter or attribute that controls the relative scale of the Shape during cloud rendering, or, equivalently, the resolution of a Cloud-output image, such as is available with your .Net and Java offerings. For that matter, what is the resolution/scale of Cloud-rendered Shapes and how is it determined?

The examples below are directly from Aspose’s documentation. Notice the “Scale=1.5” in the .Net rendering call. Is there a similar mechanism for Cloud rendering?

Thank you,

Brian Howell

Here is the example from Words for .Net: (Rendering Shapes Separately from Document|Aspose.Words for .NET)

ShapeRenderer r = shape.GetShapeRenderer();

ImageSaveOptions imageOptions = new ImageSaveOptions(SaveFormat.Emf)

{

Scale = 1.5f

};

dataDir = dataDir + “TestFile.RenderToDisk_out_.emf”;

r.Save(dataDir, imageOptions);

The seemingly equivalent Cloud PHP invocation apparently doesn’t have a comparable parameter: (https://docs.aspose.cloud/display/wordscloud/Get+Image+Data+from+a+Drawing+Object )

$wordsApi = new WordsApi();

$apiClient = new APIClient();

$fileName = “SampleWordDocument.docx”;

$objectIndex = “0”;

$imageFormat = “PNG”;

$storage = “”;

$folder = “”;

$result = $storageApi->PutCreate($fileName, “”, $storage, “d:\temp\word\” . $fileName);

$response = new \Aspose\Words\Models\ResponseMessage();

try {

$response = $wordsApi->GetDocumentDrawingObjectByIndexWithFormat($fileName, $objectIndex, $imageFormat, $storage, $folder);

echo “Saving the Drawing Ojbect!”;

$apiClient->saveFile($response, “d:\temp\word\” . “drawingObj.png”);

echo “
GetDocumentDrawingObjectByIndexWithFormat
”;

} catch (\Aspose\Words\ApiException $exp) {

echo “**Exception:** ” . $exp->getMessage();

}

Hello,

I am evaluating Aspose Cloud for a proposal. I just discovered your offerings last Thursday. Thus, I can provide neither code nor example documents. The use case is rendering embedded charts in Word and Excel documents.

I have not [yet] been able to find a rendering parameter or attribute that controls the relative scale of the Shape during cloud rendering, or, equivalently, the resolution of a Cloud-output image, such as is available with your .Net and Java offerings. For that matter, what is the resolution/scale of Cloud-rendered Shapes and how is it determined?

The examples below are directly from Aspose’s documentation. Notice the “Scale=1.5” in the .Net rendering call. Is there a similar mechanism for Cloud rendering?

Thank you,

Brian Howell

Here is the example from Words for .Net: (Rendering Shapes Separately from Document|Aspose.Words for .NET)

ShapeRenderer r = shape.GetShapeRenderer();

ImageSaveOptions imageOptions = new ImageSaveOptions(SaveFormat.Emf)

{

Scale = 1.5f

};

dataDir = dataDir + “TestFile.RenderToDisk_out_.emf”;

r.Save(dataDir, imageOptions);

The seemingly equivalent Cloud PHP invocation apparently doesn’t have a comparable parameter: (https://docs.aspose.cloud/display/wordscloud/Get+Image+Data+from+a+Drawing+Object )

$wordsApi = new WordsApi();

$apiClient = new APIClient();

$fileName = “SampleWordDocument.docx”;

$objectIndex = “0”;

$imageFormat = “PNG”;

$storage = “”;

$folder = “”;

$result = $storageApi->PutCreate($fileName, “”, $storage, “d:\temp\word\” . $fileName);

$response = new \Aspose\Words\Models\ResponseMessage();

try {

$response = $wordsApi->GetDocumentDrawingObjectByIndexWithFormat($fileName, $objectIndex, $imageFormat, $storage, $folder);

echo “Saving the Drawing Ojbect!”;

$apiClient->saveFile($response, “d:\temp\word\” . “drawingObj.png”);

echo "

GetDocumentDrawingObjectByIndexWithFormat

";

} catch (\Aspose\Words\ApiException $exp) {

echo “Exception:” . $exp->getMessage();

}

Hi Brian,

Your understanding is correct. There is no such option available in Aspose.Words or Aspose.Cells for Cloud to set image options when exporting embedded charts or other drawing objects.

We are further analyzing this requirement and will update you soon.

Best Regards,