Visual C#.NET: Create, Manipulate PDF Document

How to create, manipulate PDF documents using C#.NET
Yiigo.Image for .NET provides advanced PDF creating and manipulating support, allowing developers to load and create any PDF documents and customized according to your needs. Find more PDF creating information on Yiigo.Imaging for .NET PDF Createing Plugin.
Yiigo.Imaging for .NET PDF Creating Plugin has those following functionalities:
  • Create a PDF document according to your needs
  • Control page size and the page margin size of each section when you create
  • Create table of contents
  • Create lines, rectangle, ellipse, bezier and more on PDF documents
  • Save PDF to file, IStream and Stream
This document provides comprehensive Visual C#.NET samples for guiding developers to create, edit, manipulate and save PDF files using Yiigo.Image for .NET. Find more PDF creating & conversion tutorials on VB.NET PDF Creating, Web Imaging Createer PDF Creating Support and Create PDF Documents in .NET Winforms.
Create PDF Documents with C#.NET Sample Code

Requirements

Before creating PDF documents in Visual C#.NET, make sure that you have installed.

Start to Create PDF Documents

  • Open and run your Microsoft Visual Studio;
  • Choose "Windows Application" in the "Templates" List and name it "YiigoImagingPdfCreateCsharp";
  • Right-click on the "References" folder, and select "Add Reference..." from the context menu in the "Solution Explorer" window;
  • In the "Add Reference" dialog box, select the ".NET" tab and browse to Yiigo.Imaging.Net.dll library and Yiigo.Imaging.Net.Pdf.Generate.dll;
  • Add it to your Visual C# applications;
  • Call Yiigo .NET Image Namespace & Copy those following codes:
using System.IO;
using System.Drawing.Printing;
using Yiigo.Imaging;
using Yiigo.Imaging.Processing;
using Yiigo.Imaging.PdfGenerate;

// Create a basic PDF
PDFGeneratorDocument pdf = new PDFGeneratorDocument();
PDFGeneratorPage page = DefaultPages.Letter;
pdf.Pages.Add(page);
string font = new Font ("Arial", 10f, FontStyle. Regular);
TextLine line = new TextLine(font, 12, "Yiigo", new PdfPoint(72, 400));
page.DrawingLine.Add(line);

// Add some graphics on PDF
PDFGeneratorGraphics graphics = DefaultPages.Letter;
graphics.DrawRectangle = (System.Drawing.Color.Red, 5, new Rectangle(20, 20, 250, 200);
graphics.EllipseRectangle = (System.Drawing.Color.Red, 5, piont1(10.0F, 30.0F), Point2(50.0F, 30.0F));
graphics.BezierRectangle = (System.Drawing.Color.Red, 5, piont1(10.0F, 30.0F), Point2(50.0F, 340.0F))
piont3(15.0F, 55.0F), Point4(50.0F, 30.0F)));

// Save & print PDF
pdf.SaveToFile(String FilePath);
pdf.SaveToStream(Stream Stream);
pdf.print();
Imaging Solution
Yiigo.Image for .NET
Online C# Tutorial
C#: Yiigo.Image for .NETC#: How to StartC#: Doc Management SolutionC#: Web Doc ViewerC#: How to Deploy SDK
Doc & Image Formats
C#: PDFC#: Create, Load, Save PDFC#: PDF Doc ViewerC#: Web PDF ViewerC#: Windows PDF ViewerC#: Mobile PDF ViewerC#: Annotate PDFC#: Convert PDFC#: Convert PDF to BMPC#: Convert PDF to GIFC#: Convert PDF to JPEGC#: Convert PDF to PNGC#: Convert PDF to SVGC#: Convert PDF to TIFFC#: Compress PDF ImageC#: Add PDF MetadataC#: Extract PDF TextC#: Process PDFC#: Rotate PDF PageC#: Add PDF PageC#: Add Image to PDF PageC#: Delete PDF PageC#: Sort PDF PagesC#: Merge PDF DocumentsC#: Split PDF DocumentC#: Read PDF BarcodeC#: Generate PDF BarcodeC#: Draw on PDFC#: Draw PDF WatermarkC#: TIFFC#: WordC#: DICOM
Advanced Functions
C#: Programming with Image SDKC#: Barcode ReadingC#: Barcode GeneratingC#: Twain ScanningC#: OCR Recognition