Find and mark text occurrence in a PDF using C#

Question:I would like to parse a given PDF and add a circle when I find a certain text occurrence. Highlighting would be even better. I read it is not possible with iTextSharp. So I want to know that is there a solution on VeryPDF? Do you know any library I could use ?

Answer: According to your needs, maybe you can have a free trial of software VeryPDF PDF Editor Toolkit, by which you can highlight PDF, add circle to PDF, merge PDF and split PDF. And this is software toolkit, you can call it together with programming languages like C++, VB, Delphi, ASP, and .NET. And when you finish editing, by this software, you can also protect created PDF with 48 or 128-bit encryption. It supports both user password and owner password. Please check more related information of this software on homepage, in the following part, let us check how to use this software.

Step 1. Free download PDF Editor Toolkit Professional

  • There are two version of this software, normal version and professional version. Here I will take the professional version for example. By the professional version, you can add stamp to PDF, encrypt existing PDF, remove owner password of PDF and others.
  • When downloading finishes, there will be a zip file. Please extract it to some folder then you can check code template, help documents and others.

Step 2. Mark PDF

  • When you need to mark PDF or highlight PDF, please refer to the following parameter introduction and usage.
  • VeryAddCircle
    long VeryAddCircle(very_id id, long sx, long sy, long radius, long side_width, long side_color,
    long flagFill, long fill_color)
    Description –> Draw a circle.
    Parameters –> Id
    Returned by VeryCreate or VeryOpen function.
    sx  --> Start x-coordinate.
    sy—> Start y-coordinate.
    radius –>Specify the radius of the circle.
    side_width—>Specifies the line width in pixel.
    Side_color—> Specifies the color of the text as an RGB color value.
    flagFIll—> Whether fill this rectangle or not.
    fill_color—>The color used to fill the rectangle, in RGB format.
    Return Value
    Nonzero if it is successful; otherwise, it is zero

And when you need to encrypt PDF, this toolkit also can help you. Please refer to the following information:
long WINAPI VeryEncryptPDF(const char * inFileName, const char *outFileName, long EnctyptLen, long permission, const char *OwnerPassword, const char *UserPassword)
Parameter:
inFileName 
Input pdf filename
outFileName
Output pdf filename
EnctyptLen
The encryption level, MUST equal 40 or 128
Permission
Set permission to a pdf document; include printing, copying and
changing and enable form fields.
0: no printing, no copying and no changing
4:   allow printing
16: allow copying
8:   allow changing
32: allow AcroFormFields
For example, if you want allow printing, copying and changing, the
permission value should be 4+16+8 = 28

Please check more example in PDF Editor Toolkit user manual. 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!