Hello!
We successfully run SideBySidePdfComparer and save the result to PDF. Everything works great, but the highlight colors are not good for readability, specifically the green color for additions. Is there a mechanism to apply a different highlight color to resulting PDF when using SideBySidePdfComparer?
Thank you,
Irene Troupansky
@Irene.Troupansky
Hello Irene,
To change the background color of the highlighted changes in the resulting PDF from the SideBySidePdfComparer
, you can utilize the PdfOptions
class, which allows you to specify different colors for additions and deletions.
Here’s a simple example of how to set the highlight color for additions:
using Aspose.Pdf;
using Aspose.Pdf.Facades;
// Load the documents to compare
Document doc1 = new Document("document1.pdf");
Document doc2 = new Document("document2.pdf");
// Create a SideBySidePdfComparer instance
SideBySidePdfComparer comparer = new SideBySidePdfComparer(doc1, doc2);
// Set the highlight color for additions
comparer.PdfOptions.AdditionHighlightColor = Color.Yellow; // Change to your preferred color
// Set the highlight color for deletions (optional)
comparer.PdfOptions.DeletionHighlightColor = Color.Red; // Change to your preferred color
// Save the result
comparer.Compare("output.pdf");
In this example, you can replace Color.Yellow
and Color.Red
with any colors of your choice to enhance readability.
If you have any further customization needs or specific requirements, please let me know!
Best regards.
Hello,
Thank you for answering!
I am on version 25.10 of Aspose.PDF for .NET.
In this version SideBySidePDFComparer is a static class and cannot be instantiated: Class SideBySidePdfComparer | Aspose.PDF for .NET API Reference. It also doesn’t have a property PdfOptions.
I cannot use the code you supplied. Any other suggestion?
Best Regards,
Irene
@Irene.Troupansky
We apologize for the confusion caused by the automated response from bot. Nevertheless, we need to investigate the feasibility of this requirement in details. Would you kindly share a sample output PDF file that has been generated at your end for our reference? We will log an investigation ticket in our issue tracking system and share the ID with you.
Hello!
Thank you for answering!
I was trying to send you the file using forum@aspose.com twice, but it couldn’t get through. Now trying to do it here.
Aspose_DR_58809.pdf (270.6 KB)
Best Regards,
Irene
@Irene.Troupansky
We are generating a ticket in our issue tracking for the purpose of investigation and will be sharing its ID here shortly.
@Irene.Troupansky
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): PDFNET-60925
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.