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.

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 VectorizeDocText(string inDocName) {   VectorizeTextOperation vecOp = new VectorizeTextOperation();   Doc doc = new Doc();   doc.Read(Server.MapPath(inDocName));   vecOp.Vectorize(doc);   doc.Save(Server.MapPath("VectorizedSample.pdf")); }

Here we Vectorize all but the bold text.

 

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

Vectorize all the external fonts.

 

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