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

Free Support Forum - aspose.com

Picture grayscale conversion doesn't work in all cases

I’m trying to convert all pictures in the doc document to grayscale and then save as pdf using following code:



public void convertToGrayscale() throws Exception{

Document doc = new Document(“c:\temp\grayscale\figure-1.doc”);
doc.acceptAllRevisions();
NodeCollection shapes = doc.getChildNodes(NodeType.SHAPE, true);
for(Node node : shapes.toArray()){

Shape shape = (Shape) node;
if(shape.hasImage()){
shape.getImageData().setGrayScale(true);
System.out.println("convert shape to grayscale ");
}
}

doc.save(“c:\temp\grayscale\output.pdf”, new PdfSaveOptions());

}

After execution on console :

convert shape to grayscale
convert shape to grayscale

According output, all pictures in the documet were marked as grayscale (figure-1.doc) but in resulting pdf only one was converted. What should I else do to convert all pictures ? (I’m using Aspose Words jdk16 13.5.0.0)

Hi Tomasz,


Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 13.5.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The issue ID is WORDSNET-8431. Your request has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-8431) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.