[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Collapse]Office File API
  Demo Application
  Redistribution and Deployment
 [Expand]Spreadsheet Document API
 [Expand]Word Processing Document API
 [Collapse]PDF Document API
   Getting Started
   Coordinate Systems
   Document Generation
  [Expand]PDF Graphics
  [Expand]Document Manipulation
  [Expand]Additional Content
  [Expand]Interactive Forms
  [Expand]Text Markup Annotations
  [Expand]Document Security
  [Collapse]Examples
   [Collapse]Document Creation API
     How to: Generate a Document Layout from Scratch
     How to: Create Graphics in a Document with Landscape and Portrait Page Orientations
     How to: Add a Link to a Page
     How to: Add a Link to URI
     How to: Add Bookmarks to a Document
     How to: Bookmark Search Results in a Document
     How to: Highlight Search Results in a Document
     How to: Create an Interactive Form
     How to: Attach a File to a Document
   [Expand]Interactive Form
   [Expand]Text Markup Annotation
   [Expand]Extract Content from a PDF Document
   [Expand]Manage Pages of a PDF Document
   [Expand]Document Protection
   [Expand]Printing
   [Expand]Export a PDF Document to an Image
 [Expand]Excel Export Library
 [Expand]Snap Report API
 [Expand]Zip Compression and Archive API
 [Expand]Barcode Generation API
 [Expand]Unit Conversion API
 [Expand]API Reference
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Create Graphics in a Document with Landscape and Portrait Page Orientations

Important

The Universal Subscription or an additional Office File API Subscription is required to use this example in production code. Refer to the DevExpress Subscription page for pricing information.

This example shows how to add text to the top left and bottom right of a page in a document with landscape and portrait pages.

PDF graphics are represented by an instance of the PdfGraphics class. To create graphics, call the PdfDocumentProcessor.CreateGraphics method. To access PdfGraphics, you need to reference the DevExpress.Pdf.Drawing assembly.

To rotate text that should be drawn in a document with landscape and portrait pages, call the PdfGraphics.RotateTransform method.

To move rotated text to desired position (bottom right) on a page, call the PdfGraphics.TranslateTransform method.

To draw text on a page, call the PdfGraphics.DrawString method with the specified text, font, brush and location.

To add graphics to a page foreground, call the PdfGraphics.AddToPageForeground method.

Expanded See Also

Is this topic helpful?​​​​​​​