Vectorizes the text glyphs in the pages of a document.

 

   

Syntax
 

[C#]
void Vectorize(Doc doc)
void Vectorize(Pages pages)
void Vectorize(Page page)

[Visual Basic]
Sub Vectorize(doc As Doc)
Sub Vectorize(pages As Pages)
Sub Vectorize(page As Page)

Throws Exceptions may throw Exception()

 

   

Params
 
Name Description
doc The document containing the pages of text to be vectorized.
pages The pages of text to be vectorized as referenced by a Pages IndirectObject.
page The page of text to be vectorized as referenced by a Page IndirectObject.

 

   

Notes
 

Vectorizes the text glyphs on pages in the document.

The VectorizeTextOperation operation removes font glyphs and replaces them with polygonal outlines that appear the same.

Note that pages may sometimes share content with other pages. If this is the case then vectorizing the text on one page will also vectorize it on other pages which use this shared content.

The Operation.ProcessingObject property is used to give the user some control over which fonts would be vectorized. Setting the ProcessingObjectEventArgs.Cancel to 'true' turns off the vectorization for the particular font that's passed in to the Processing method (see examples below)

Please see the FontObject class for more information on the ProcessingObjectEventArgs.Object argument

The Operation.ProcessedObject property is not used with this operation

 

   

Example
 

Here we vectorize all the text in the document.

 

static void VectorizeDocText1(string inDocName) {   var op = new VectorizeTextOperation();   using var doc = new Doc();   doc.Read(Server.MapPath(inDocName));   op.Vectorize(doc);   doc.Save(Server.MapPath("VectorizedSample.pdf")); }

Here we Vectorize all but the bold text.

 

static void Vectorizing2(object sender, ProcessingObjectEventArgs e) {   var font = e.Object as FontObject;   if (font != null && font.BaseFont.Contains("Bold"))     e.Cancel = true; } static void VectorizeDocText2(string inDocName) {   var op = new VectorizeTextOperation();   Doc doc = new Doc();   doc.Read(Server.MapPath(inDocName));   // Use the 'Vectorizing' method to decide which fonts to vectorize   op.ProcessingObject += new ProcessingObjectEventHandler(Vectorizing2);   op.Vectorize(doc);   doc.Save(Server.MapPath("VectorizedSample.pdf")); }

Vectorize all the external fonts.

 

static void Vectorizing3(object sender, ProcessingObjectEventArgs e) {   var font = e.Object as FontObject;   if (font != null && font.EmbeddedFont != null)     e.Cancel = true; } static void VectorizeDocText3(string inDocName) {   var op = new VectorizeTextOperation();   Doc doc = new Doc();   doc.Read(Server.MapPath(inDocName));   // Use the 'Vectorizing' method to decide which fonts to vectorize   op.ProcessingObject += new ProcessingObjectEventHandler(Vectorizing3);   op.Vectorize(doc);   doc.Save(Server.MapPath("VectorizedSample.pdf")); }