Developer Tools
|
Office Productivity Applications
|
Platform-Agnostic APIs
|
Home | Online Demos | Downloads | Buy Now | Support | About Us | News | Working Together | Contact Us
PDF format offers a great depth of features that you can use to spruce up your PDF documents. For this article, I will focus on rendering text, shapes, and images that appear translucent on a PDF document using Gnostice PDFOne .NET.
To change the level of transparency of PDF elements, you just need to specify the alpha value of the color used by the pen and brush objects of PDFPage
, which are used to stroke and fill PDF elements such as text and shapes.
Color.FromArgb Method(Int32, Color) public static Color FromArgb( int alpha, Color baseColor );
When the alpha value is 0, the PDF element will rendered completely transparent i.e., it will not be visible even though it is present in the PDF. When the alpha value is set to 255, the PDF element appears totally opaque. The corollary then is that we need to vary the alpha value as required, specify the color, and then render the PDF element.
PDFPage page = new PDFPage(); // Sets alpha value for brush color page.Brush.Color = Color.FromArgb(30, Color.Blue); // Writes translucent text page.WriteText("This is transparent text", 1, 2.5f); // Changes alpha value for brush color page.Brush.Color = Color.FromArgb( 40, Color.YellowGreen); // Draws a translucent ellipse page.DrawEllipse(Pens.Black, new RectangleF(1, 3.5f, 2, 1), true, true); // Changes alpha value of brush color again page.Brush.Color = Color.FromArgb( 10, Color.Empty); // Draws a translucent image page.DrawImage("image.bmp", new RectangleF(1, 4.5f, 2, 1));
You have learned how to set transparency levels for text, shapes, and images in PDF. Now, with some imagination and/or practice, you will be able create translucent PDF elements along with smartly-positioned overlays. Your PDF documents may then sport an elegant and attractive look.
Downloads:
---o0O0o---
Our .NET Developer Tools | |
---|---|
Gnostice Document Studio .NETMulti-format document-processing component suite for .NET developers. |
PDFOne .NETA .NET PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, and bookmark PDF documents in .NET applications. |
Our Delphi/C++Builder developer tools | |
---|---|
Gnostice Document Studio DelphiMulti-format document-processing component suite for Delphi/C++Builder developers, covering both VCL and FireMonkey platforms. |
eDocEngine VCLA Delphi/C++Builder component suite for creating documents in over 20 formats and also export reports from popular Delphi reporting tools. |
PDFtoolkit VCLA Delphi/C++Builder component suite to edit, enhance, view, print, merge, split, encrypt, annotate, and bookmark PDF documents. |
Our Java developer tools | |
---|---|
Gnostice Document Studio JavaMulti-format document-processing component suite for Java developers. |
PDFOne (for Java)A Java PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, bookmark PDF documents in Java applications. |
Our Platform-Agnostic Cloud and On-Premises APIs | |
---|---|
StarDocsCloud-hosted and On-Premises REST-based document-processing and document-viewing APIs |
Privacy | Legal | Feedback | Newsletter | Blog | Resellers | © 2002-2024 Gnostice Information Technologies Private Limited. All rights reserved. |