I’m trying to extract text from pdf file with specific color.
Pdf file is prepared with Aspose.Words. Text color is set to RGB (0,0,254). When I’m reading it in Acrobat Professional, text blue part is still 254. But when I’m trying to check it with Aspsoe.Pdf I’m getting 253. But if I use RGB (0,0,255) on word doc in Aspose.Pdf everything looks Ok.
Tested with Aspose.Pdf 7.1 and 7.4.
public void Correct_Text_Color()
Aspose.Words.Document doc = new Aspose.Words.Document();
DocumentBuilder docBuilder = new DocumentBuilder(doc);
docBuilder.ParagraphFormat.Style.Font.Color = System.Drawing.Color.FromArgb(0, 0, 254);
Aspose.Pdf.Document pdfDoc = new Aspose.Pdf.Document(“Bluetext.pdf”);
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber();
foreach (TextFragment textFragment in textFragmentAbsorber.TextFragments)
Assert.AreEqual(254, textFragment.TextState.ForegroundColor.B, “Incorrect foreground color!”);
//Assert.AreEqual(“ff0000fe”, textFragment.TextState.ForegroundColor.Name, “Incorrect foreground color!”);
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thank you for the sample code.
I am able to reproduce your mentioned issue after an initial test. Your issue has been registered in our issue tracking system with issue id: PDFNEWNET-34370. We will inform you via this forum thread regarding any updates. As you have reported this issue under normal support forum, please confirm if you need us to move this issue under Enterprise Support.
Sorry for the inconvenience,