Images


Bytescout_PDF_Images_1.png

using System;
using System.Collections.Generic;
using System.Text;
using Bytescout.PDF;
namespace Images
{
  class Program
  {
    static void Main(string[] args)
    {
      // Create main PDF Doc Engine
      PDFDocEngine engine = new PDFDocEngine("", "");
      // Add new document
      Document document = engine.AddDocument();
      // Add images to the document
      uint jpgImage = document.AddImage("Image.jpg", 0, ImageCompressionType.JPEG);
      uint tiffImage = document.AddImage("Image.tif", 0, ImageCompressionType.Flate);
      // Append new page to the document
      Page page = document.AddPage(PageSizeType.A3, PageOrientationType.LandScape);
      // Create new drawing
      Drawing drawing = page.AddDrawing();
      // Show images
      drawing.PlaceImage(jpgImage, 400, 400, 320, 382, 40);
      drawing.PlaceImage(tiffImage, 600, 400, 320, 321, 00);
      // Closing drawing on the page
      drawing.Close();
      // Save document
      document.Save("Images.pdf");
    }
  }
}