Problem With GroupDocs.Redaction 20.7 with word document

I have a template where I am replacing Text from #Ref001 to whatever I want. This is working fine in all the files but not working in doc files.

in the doc files it is only replacing 1 or 2 instances but not all the instances
I am sharing the files as well as the piece of code for your reference.

File_Redaction.zip (15.0 KB)

my code.

var filePath = "E:\\Download\\Redact\\File.xlsx";
using (Redactor redactor = new Redactor(filePath))
{
    redactor.Apply(new ExactPhraseRedaction("#Ref001", new ReplacementOptions("10")));
    GroupDocs.Redaction.Options.SaveOptions saveOption = new GroupDocs.Redaction.Options.SaveOptions()
    {
        AddSuffix = true,
        RasterizeToPDF = false,
        RedactedFileSuffix = "Redaction"
    };
    redactor.Save(saveOption);
}

I checked online and it is working fine in the latest version.

It will be better for me if I get the solution on priority

Thank you in advance

@Niteen_Jadhav

We couldn’t reproduce this issue using latest version of the API - image.png (22.1 KB)

Because that web application is developed using latest version of GroupDocs.Redaction.

Yes but this issue is coming on version 20.7 and 20.9.

How can I fix this?

@Niteen_Jadhav
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): REDACTIONNET-486

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.

Hello Atir,

Do we have any updates on this?

Hello @Niteen_Jadhav

Thank you for your request. The issue you mentioned was addressed in a later version of GroupDocs.Redaction and GroupDocs.Total. Unfortunately, according to our policy, we cannot fix and publish updates for specific old versions with expired licenses.

The latest versions work fine for your document and use-case.

I recommend downloading the latest versions of Redaction or Total and requesting a temporary license to ensure that the fix works on your side. We have tested it on your document and verified it with more complex cases as well. After confirming the fix, you can renew your license to continue using the latest product versions.

Thank you!

I requested for a Trial license and got one I updated the solution and I am getting error on below codes

watermark = new Watermark(globalConfiguration.GetViewerConfiguration().GetWatermarkText())
{
    Color = System.Drawing.Color.Blue,
    Position = Position.Diagonal,
};

Cannot implicitly convert type ‘System.Drawing.Color’ to ‘GroupDocs.Viewer.Drawing.Argb32Color’

JoinOptions joinOptions = new JoinOptions(1, noOfPages, RangeMode.AllPages);
using (Merger merger = new Merger(filePath1))
{
    merger.Join(filePath2, joinOptions);
    merger.Save(filePathOut);
}

‘JoinOptions’ does not contain a constructor that takes 3 arguments

MemoryStream result = new MemoryStream();
PreviewOptions previewOptions = new PreviewOptions(pageNumber => result)
{
    PreviewFormat = PreviewOptions.PreviewFormats.PNG,
    PageNumbers = new[] { pageNumberToRender },
};

signature.GeneratePreview(previewOptions);

Error CS0121 The call is ambiguous between the following methods or properties: ‘PreviewOptions.PreviewOptions(PreviewOptions.CreatePageStream, params int[])’ and ‘PreviewOptions.PreviewOptions(PreviewOptions.CreateDocPageStream, params int[])’

@Niteen_Jadhav

Please spare us some time to investigate this scenario.

When can I expect a solution on this?

Please Note: We can’t proceed to the latest version without fixing these issues

@Niteen_Jadhav

From last many releases some public API changes were introduced, that’s why your legacy code is not compatible.

The updated code is:

PageJoinOptions joinOptions = new PageJoinOptions(1, 4, RangeMode.OddPages);

To set background or foreground color, the updated code is as follows:

TextWatermark watermark = new TextWatermark("Contract Draft", new Font("Arial", 60, FontStyle.Bold));
watermark.ForegroundColor = Color.DarkGreen;
watermark.BackgroundColor = Color.DarkGreen;

And for this issue, take a look at the following code:

PreviewOptions previewOption = new PreviewOptions(CreatePageStream, ReleasePageStream)
{
       PreviewFormat = PreviewOptions.PreviewFormats.JPEG,
       // set property to hide all known signatures
       HideSignatures = true
};

We’d suggest you to go though the documentations of the concerned APIs.

PreviewOptions (98.1 KB)

getting the above warning

complete code →
Complete Code (95.8 KB)

and for Watermark I am getting the below error →

Error CS0029 Cannot implicitly convert type ‘GroupDocs.Watermark.Watermarks.TextWatermark’ to ‘GroupDocs.Viewer.Options.Watermark’

Code Screenshot (96.0 KB)

@Niteen_Jadhav

Please share a simple console application with us using that issue could be reproduced at our end.

Thank you for the reply, It will be really difficult for me to create a project from scratch. can you please do try to look into this without the project.

@Niteen_Jadhav

We have working samples here on GitHub. Please utilize updated/latest API version. Let us know in case of any issue.

In that sample they using Groupdocs.Signature but in my solution I am using Groupdocs.Total

Sharing the code and screenshot for your reference.

GroupDocs Total (101.4 KB)

GroupDocs Signature (100.7 KB)

MemoryStream result = new MemoryStream();
PreviewOptions previewOptions = new PreviewOptions(pageNumber => result)
{
    PreviewFormat = PreviewOptions.PreviewFormats.PNG,
    PageNumbers = new[] { pageNumberToRender },
};

but when I change my code to →

PreviewOptions previewOption = new PreviewOptions(CreatePageStream, ReleasePageStream)
{
    PreviewFormat = PreviewOptions.PreviewFormats.PNG,
    PageNumbers = new[] { pageNumberToRender },
};

a prompt is coming to add [Obsolete] in a method header

@Niteen_Jadhav
As far as following error is concerned:

|Error|CS0121|The call is ambiguous between the following methods or properties: 'PreviewOptions.PreviewOptions(PreviewOptions.CreatePageStream, params int[])' and 'PreviewOptions.PreviewOptions(PreviewOptions.CreateDocPageStream, params int[])'

The issue is that the PreviewOptions class has two constructors:

  1. PreviewOptions(PreviewOptions.CreatePageStream, params int[]): This constructor takes a PreviewOptions.CreatePageStream delegate and an optional array of page numbers.
  2. PreviewOptions(PreviewOptions.CreateDocPageStream, params int[]): This constructor takes a PreviewOptions.CreateDocPageStream delegate and an optional array of page numbers.

In your code, you’re passing pageNumber => result as the first argument, which could match either of the constructors. Hence, causing the ambiguity.
To fix this issue, you need to explicitly specify which constructor you want to use. You can do this by casting the lambda expression to the appropriate delegate type:

MemoryStream result = new MemoryStream();
PreviewOptions previewOption = new PreviewOptions((PreviewOptions.CreatePageStream)((int pageNumber) => result), new[] { 1 });

In this example, we cast the lambda expression (int pageNumber) => result to the PreviewOptions.CreatePageStream delegate, which resolves the ambiguity and allows the code to compile.

Alternatively, you can also try using the PreviewOptions.CreateDocPageStream delegate if that’s more appropriate for your use case:

MemoryStream result = new MemoryStream();
PreviewOptions previewOption = new PreviewOptions((PreviewOptions.CreateDocPageStream)((int pageNumber) => result), new[] { 1 });

By doing this the error will go away but you may face some warnings. To address those warnings, 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): TOTALNET-104

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.

Thank you, the issue is fixed after applying this code change, but after that we had notice few points.

SignedDocumentEntity signedDocument = new SignedDocumentEntity();
using (GroupDocs.Signature.Signature signature = new GroupDocs.Signature.Signature(documentGuid, GetLoadOptions(password)))
{
    signature.Sign(tempPath, signsCollection, saveOptions);
}// this document is not getting signed and no error coming on Groupdocs.total (20.8) but working on Groupdocs.signature (20.8) and Groupdocs.total (24.5)

Digital Signature is not working in any version (169.8 KB) I am getting Sign document error: Cannot find the requested object. error on signature.Sign (96.4 KB) line

  1. How digital signature validate if the .pfx file is valid or not?

NOTE: I am not able to check this functionality online as I am getting THIS (65.5 KB) error after I add PDF Here (77.8 KB)

My Sample pdf (22.6 KB)

@Niteen_Jadhav

Could you please share more details on point 1 and 2? It would be great if you share a screencast with us and also mention the API version you are using in the screencast.

We are investigating this scenario. Your investigation ticket ID is TOTALNET-105.

This issue is also under investigation SIGNATUREAPP-1018.

The issues you have found earlier (filed as TOTALNET-104) have been fixed in this update. This message was posted using Bugs notification tool by yevgen-nykytenko

I had spoken about 2/3 issues. which issue is fixed?