Text
View as MarkdownAdd a tiled watermark to PDF pages
This sample shows how to add a semi-transparent, rotated text watermark to every page of an existing PDF file. It demonstrates copying each source page's content into a new PDF with PdfReader, PdfWriter, and GraphicsContainer, then using TilingBrush to repeat rotated PlainText across the page as a watermark pattern.
Art text
Shows different types of art texts.
Colored Text
Renders formatted, multi-colored text onto a bitmap.
Colored Watermark
Demonstrates how to apply a colored watermark to an image using a tiling brush with text rendering.
Create Business Card
Creates business card in PDF format.
Create Multipage PDF
Creates multipage PDF with personalized wedding invitations.
Double Outline
Demonstrates how to draw a text with double outline.
Draw Lists
Draws formatted text with ordered and unordered lists.
Draw Paragraphs
Draws formatted text with several paragraphs.
Draw Path
Draws path on Graphics.
Draw Spot On CMYK
Draws a text and an image on the spot channel, using the existing CMYK image as a background.
Draw text watermark on thumbnail image
This sample shows how to create a thumbnail image and draw a semi-transparent text watermark on top of it using the GraphicsMill transforms and advanced drawing APIs. It demonstrates how to resize the source image with the Resize transform, register a custom font, and render text with Drawer and PlainText. You can read more information about drawing in the documentation.
Font API
Draws text without text objects, only with getting char info + simple metrics.
Font Fallback
Draws multilanguage text with font fallback support.
Font Metrics
Adds font to FontRegistry from file and shows its metrics.
Gradient Color
Demonstrates drawing text with a gradient fill.
Lay out paragraphs, lists, and tab-aligned columns in a PDF
This sample shows how to lay out a page of formatted text directly in a PDF using BoundedText's XML-based markup: regular paragraphs with first-line indentation and paragraph spacing, a bulleted list with custom line leading, and a two-column schedule where each session's title flows from the left and its time is pushed to a right-aligned tab stop by a dot leader, the classic layout of a printed program or table of contents.
Load fonts on demand with the FontMissing event
This sample shows how to start with an empty font registry and add only the fonts a design actually uses, at the moment it asks for them. When a font is requested by a PostScript name that is not registered, CustomFontRegistry raises the FontMissing event; the handler looks the name up in the application's own font catalog and adds the file with CustomFontRegistry.Add, and the request then succeeds. A server with a large font library no longer has to parse every font at startup.
Map template font names with aliases and remove fonts
This sample shows how to keep a font registry in step with a font library that changes while the application runs. CustomFontRegistry.Add reports for every face it reads a FontAddResult with the PostScript name and a status, for example AlreadyPresent when the same file is added twice. CustomFontRegistry.AddFontAlias attaches extra names to a registered font, so templates can refer to fonts by role ("Brand-Heading") rather than by file. CustomFontRegistry.Remove unregisters a font that was deleted from the library without rebuilding the registry, and PostscriptNameCollisionPolicy decides whether a new file with an already registered PostScript name replaces the old one.
Reflected Text
Exhibits a possible technique for implementing a mirrored text effect.
Show Custom Font Metrics
Adds font to FontRegistry from file and shows its metrics.
Subscript and Superscript
Draws subscript and superscript text.
Text Effects
Demonstrates how to use shadow and glow effects for drawing text.
Write raster and vector graphics to EPS
Saves raster and vector graphics to EPS format.
Write Raster And Vector Graphics To PDF
Saves raster and vector graphics to PDF format.
Write Text To PDF
Demonstrates writing text as PDF text.