Replacing embedded PNG

Hello Alexey,

We wondering if there is any news about this issue. In your previous post you told us you would get back to us in about a month, but it’s been 5 months already.

Hi

Thanks for your request. Unfortunately, there are no news regarding this issue yet.

Best regards,

Hi there,

Regarding your request, we will try implement this in the next few releases.

In the mean time you can still find these sorts of properties without converting the final document to DOC. Please see the code below which will find the name of a DrawingML object without converting the original document to DOC.

string name = DrawingMLNameFinder.GetName(drawingML);
public class DrawingMLNameFinder
{
    private static Hashtable mDocuments = new Hashtable();

    public static string GetName(DrawingML drawingML)
    {
        Document doc = (Document)drawingML.Document;
        if (!mDocuments.ContainsKey(doc))
        {
            // Convert DOCX to DOC to get access to images.
            MemoryStream docStream = new MemoryStream();
            doc.Clone().Save(docStream, SaveFormat.Doc);
            mDocuments.Add(doc, new Document(docStream));
        }
        Document doc2 = (Document)mDocuments[doc];
        // Find the image from the converted document by comparing indices.
        Shape shape = (Shape)GetImageNodes(doc2)[GetImageNodes(doc).IndexOf(drawingML)];
        return shape.Name;
    }

    private static ArrayList GetImageNodes(Document doc)
    {
        // Find all nodes in the document and removes the non-image types from the list.
        ArrayList imageNodes = new ArrayList(doc.GetChildNodes(NodeType.Any, true).ToArray());
        ArrayList nodesToRemove = new ArrayList();
        foreach (Node node in imageNodes)
            if (node.NodeType != NodeType.DrawingML && node.NodeType != NodeType.Shape)
                nodesToRemove.Add(node);

        foreach (Node node in nodesToRemove)
            imageNodes.Remove(node);

        return imageNodes;
    }
}

We will keep you informed of any developments.

Thanks,

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


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

Hello,

this update does only seem to expose the AlternativeText property and not the Name property we are using. Is this going to be implemented at all?

Regards

Paul Vrugt
Sr Software Engineer
Infoland BV

Hello

Thanks for your inquiry. Please try using the following code:

Document doc = new Document("C:\\Temp\\in.docx");
DrawingML drawingMl = (DrawingML)doc.GetChild(NodeType.DrawingML, 0, true);
Console.WriteLine(drawingMl.Name);

Also please check the attached document.

Best regards,

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


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