ByteScout PDF Suite - C# - Set text rotation in pdf with pdf sdk - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout PDF Suite – C# – Set text rotation in pdf with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Suite – C# – Set text rotation in pdf with pdf sdk

How to set text rotation in pdf with pdf sdk in C# using ByteScout PDF Suite

Learn to code in C# to set text rotation in pdf with pdf sdk with this step-by-step tutorial

We made thousands of pre-made source code pieces for easy implementation in your own programming projects. ByteScout PDF Suite is the bundle that provides six different SDK libraries to work with PDF from generating rich PDF reports to extracting data from PDF documents and converting them to HTML. This bundle includes PDF (Generator) SDK, PDF Renderer SDK, PDF Extractor SDK, PDF to HTML SDK, PDF Viewer SDK and PDF Generator SDK for Javascript. It can set text rotation in pdf with pdf sdk in C#.

The following code snippet for ByteScout PDF Suite works best when you need to quickly set text rotation in pdf with pdf sdk in your C# application. Just copy and paste the code into your C# application’s code and follow the instructions. Applying C# application mostly includes various stages of the software development so even if the functionality works please test it with your data and the production environment.

All these programming tutorials along with source code samples and ByteScout free trial version are available for download from our website.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using System.Diagnostics; using Bytescout.PDF; namespace Text_Rotation { class Program { static void Main(string[] args) { // Create PDF document Document document = new Document(); document.RegistrationName = "demo"; document.RegistrationKey = "demo"; // Create page Page page = new Page(PaperFormat.A4); // Add page to document document.Pages.Add(page); Canvas canvas = page.Canvas; // Prepare font and brush Font font = new Font(StandardFonts.Helvetica, 24); SolidBrush blackBrush = new SolidBrush(); // Draw simple text canvas.DrawString("Simple text.", font, blackBrush, 50, 100); // Save canvas state canvas.SaveGraphicsState(); // Move canvas origin (0,0) point to (50,100) canvas.TranslateTransform(50, 100); // Rotate canvas at 45 deg around of the origin point canvas.RotateTransform(45); canvas.DrawString("Rotated 45", font, blackBrush, 0, 0); // Rotate another 45 deg canvas.RotateTransform(45); canvas.DrawString("Rotated 90", font, blackBrush, 0, 0); // Restore canvas state to reset all transformations canvas.RestoreGraphicsState(); // Save document document.Save("result.pdf"); // Open result document in default associated application (for demo purpose) ProcessStartInfo processStartInfo = new ProcessStartInfo("result.pdf"); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next