FlattenTransparencyOperation FlattenTransparency Function. Flatten the transparency of pages in a document. ABCpdf .NET PDF Library.

ABCpdf .net

 
   

Flatten the transparency of pages in a document.

 

   
Syntax  

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

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

Throws Exceptions may throw Exception()

 

   

Params
 
Name Description
doc The document containing transparency to be flattened.
pages The pages whose transparency is to be flattened as referenced by a Pages IndirectObject.
page The page whose transparency is to be flattened as referenced by a Page IndirectObject.

 

   

Notes
 

Flattens the transparent objects on pages in the document.

When transparent objects overlap other objects, all or a portion of the overlapped object shows through. FlattenTransparency will create new objects that represent the portion of the two objects that overlap. Portions of transparent objects that don't overlap other objects are composited with the backdrop color (white) to create a fully opaque object that appears the same.

Note that this feature is only available under the ABCpdf Professional License.

 

   

Example
 

Here we flatten all the transparent objects in a document.

[C#]

FlattenTransparencyOperation transOp = new FlattenTransparencyOperation();
transOp.DotsPerInch = 144;
transOp.ColorSpace = XRendering.ColorSpaceType.Rgb;

Doc theDoc = new Doc();
theDoc.Read(Server.MapPath("../mypics/sample.pdf"));
transOp.Flatten(theDoc);
theDoc.Save(Server.MapPath("../Flattened/sample.pdf"));