Aspose.Pdf for .NET是一款专门用于处理PDF文档的控件,不仅可以创建、编辑和保存PDF文档,还可以对PDF文档进行各种复杂的操作、分割、合并、插入页眉页脚、添加水印、转换为其它文档格式等,在新发布了12.0后开发人员可以利用API对PDF文档内的图形对象进行渐变色的填充,具体可以参考下面的C#代码:
// Create Document instance
Document doc = new Document();
// Add page to pages collection of PDF file
// Create Graph instance
// Add graph object to paragraphs collection of page instance
page.Paragraphs.Add(graph);
// Create Rectangle instance
// Add rectangle object to shapes collection of Graph object
graph.Shapes.Add(rect);
// Specify Gradient fill color for Graph object
{
};
// Save PDF file
doc.Save("GradiantFill.PDF");