Saving to an image causes image revision lines to disappear

When saving a document as an image, if there are (red) revision lines on the image because it was added or removed the lines to not appear.

The file upload doesn’t appear to be working right now. To recreate the issue just:

  • Create a new docx
  • Add an image to it
  • Turn on track changes
  • Copy/Paste the image
  • Delete the old image

Save the document to png/jpg and the redlining won’t be in the export. There appear to be two related issues, one is the line for deleted are gone completely, the other is the additions lines get hidden if no paragraph marker between them.

@faith113

When saving a document as an image, if revision lines (such as red lines for deletions) are not appearing, it may be due to how the document is being rendered. Here are some steps and considerations to help address this issue:

  1. Ensure Track Changes is Enabled: Make sure that the “Track Changes” feature is enabled in your document before making any modifications. This will ensure that any additions or deletions are marked correctly.

  2. Use the Correct Save Options: When saving the document as an image, you can specify various options that may affect how the content is rendered. For example, using ImageSaveOptions, you can set properties like PageSet to specify which pages to render, and GraphicsQualityOptions to enhance the rendering quality.

  3. Check for Paragraph Markers: If the addition lines are hidden when there are no paragraph markers between them, consider adding a space or a line break to ensure that the revision lines are rendered correctly.

  4. Test with Different Formats: Sometimes, the format you are saving to (e.g., PNG, JPEG) can affect how elements are rendered. Try saving the document in different formats to see if the issue persists.

  5. Review Rendering Options: You can also explore the MetafileRenderingOptions to control how metafiles are processed during the image saving process. This can be particularly useful if your document contains complex graphics or shapes.

Here is a sample code snippet that demonstrates how to save a document with specific image save options:

Document doc = new Document("path/to/your/document.docx");
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Png)
{
    PageSet = new PageSet(0), // Specify the page to render
    GraphicsQualityOptions = new GraphicsQualityOptions
    {
        SmoothingMode = SmoothingMode.AntiAlias,
        TextRenderingHint = TextRenderingHint.ClearTypeGridFit
    }
};

doc.Save("path/to/save/image.png", options);

By following these steps and adjusting the save options, you should be able to retain the revision lines when exporting your document to an image format. If the problem persists, consider checking for updates or patches for the Aspose.Words library, as there may be improvements or bug fixes related to this functionality.

@faith113 Could you please zip and attach your input, output and expected output documents here for testing? We will check the issue and provide you more information.

Thanks Alexey, here you go. This shows both failures on the “add” and “remove”. The “add” line issue can be workaround by adding space between the images but I’d rather not do that.

imageInOLERevisions.zip (1.5 MB)

@faith113
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-27305

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.