How to programmatically change font color of text in PDF?

Question:I'm not familiar with the PDF specification at all. I was wondering if it's possible to directly manipulate a PDF file so that certain blocks of text that I've identified as important are highlighted in colors of my choice. I hope I can programmatically change font color of text in PDF.  Is there any solution on VeryPDF?

Answer: According to your needs, VeryPDF has three software which can help you change font color of PDF. They are PDF Text Replacer, PDF Editor and PDF Editor Toolkit. But if you need to change font of PDF programmatically, you’d better choose PDF Editor Toolkit, which can help you change PDF font together with other programming languages like C++, VB, Delphi, ASP, and .NET. With these SDKs, developers can implement PDF editing functions in their software without other PDF editing software.Please check more information of this software on homepage, in the following part, let us check how to make it work.

Step 1. Free download PDF Editor Toolkit Professional

  • When downloading finishes, it is a zip file. Please extract it to some folder then you can call it from other programming applications.
  • There are two versions of this software, normal version and professional version. Please check their difference in Comparison tab.

Step 2. Change fonts of PDF programmatically.

  • Please check detail usage and parameters from following.
  • Description :The VeryAddTextEx function writes a character string at the specified location, using
    the currently selected font, text color, if x = y = -1, indicate the text string will be drawing at
    current text position, default text position is (64, 64).
    Parameters
    Id:Returned by VeryCreate or VeryOpen function.
    x:Specifies the logical x-coordinate of the reference point that the system uses to
    align the string, the x-coordinate will moved automatically.
    y:Specifies the logical y-coordinate of the reference point that the system uses to
    align the string, the y-coordinate will moved automatically.
    string: Pointer to the string to be drawn, this string may include "\n" symbol
    color:Set text color, you may use RGB macro to combine this value.
    Return Value:Nonzero if it is successful; otherwise, it is zero

  • Please find the font position by X and Y parameter then change the font color by parameter color.
  • width and height:Specifies rectangle width and height.
    string: Pointer to the string to be drawn, this string may include "\n" symbol.
    color: Set text color, you may use RGB macro to combine this value.
    bkcolor: Set rectangle fill color, you may use RGB macro to combine this value.
    If this value equal ¨C1 then no fill color
    By this method you can change PDF font color within an area.

By this professional application, you can change font of PDF automatically. During the using, if you have any question, please contact us as soon as possible. 

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

This entry was posted in PDF Editor Toolkit and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!