MultiColoring letters

I am trying to multicolor a letter from a pdf using Python.
For example i wanted to color all the “a” letters in the pdf, i managed to give a single color using aspose to extract the text and then color it.

Does anyone know if i can give four different colors one “a”.

Is there a way to split the letter in 4 dimensions and give them different cοlor coordinates?

@aggemero

Please check this example to apply gradient color to the selected text using Aspose.PDF for .NET and let us know if it helps.

I am struggling with the process of using the GradientAxialShading in python.
Do you have any ideas?
Here is the code that i am working and i want to add the GradientAxialShading to multicolor the letter a.

import aspose.pdf as pdf

# Open the PDF document

inputPDFFile = pdf.Document("Helloa.pdf")

# Instantiate a TextFragmentAbsorber object

txtAbsorber = pdf.text.TextFragmentAbsorber("(?i)a")

# Set TextSearchOptions

search_options = pdf.text.TextSearchOptions(True)

txtAbsorber.text_search_options = search_options

# Search text

inputPDFFile.pages.accept(txtAbsorber)

# Get reference to the found list

textFragmentCollection = txtAbsorber.text_fragments

# Parse all the searched text fragments

for txtFragment in textFragmentCollection:

    #

    #

    #      INSERT CODE HERE

    #

    #

# Save the output PDF

inputPDFFile.save("output.pdf")

print("Text found and replaced successfully")

@aggemero

We need to investigate this requirement while using Aspose.PDF for Python via .NET. Can you please your sample source PDF with an expected output document? We will log an investigation tickets and share the ID with you.

This is the pdf that i am working on as an example Helloa.pdf (8.1 KB)
I want the output document to have the same text, but all the “a” letters will be colored with 2 or more colors giving a multicoloring effect.

@aggemero

A feature request as PDFPYTHON-82 has been logged in our issue tracking system to analyze these requirements. We will look into its details and let you know as soon as it is implemented. Please be patient and spare us some time.

We are sorry for the inconvenience.