LEADTOOLS画像ファイルサポート(Leadtools.Codecsアセンブリ)

フレームを表示

CodecsRasterPdfInfo構造体








メンバ 
LEADTOOLS PDF Pro、Pro Suite、DocumentまたはMedical製品で利用できるサポートを用いて作成されるラスターPDFファイルのために、情報を格納します。
オブジェクトモデル
構文
public struct CodecsRasterPdfInfo : System.ValueType 
'Declaration
 
Public Structure CodecsRasterPdfInfo 
   Inherits System.ValueType
'Usage
 
Dim instance As CodecsRasterPdfInfo
public class CodecsRasterPdfInfo
@interface LTCodecsRasterPdfInfo : NSObject
public final class CodecsRasterPdfInfo
JAVASCRIPT_NOSTRUCTS
public value class CodecsRasterPdfInfo : public System.ValueType 
解説

いろいろなRasterCodecs.GetInformationメソッドは、ディスクまたはストリームのラスター画像ファイルに関する情報を返すのに用いられます。形式、サイズ、寸法、ビット数などの情報が、RasterCodecs.GetInformationから返されるCodecsImageInfoオブジェクト。から返されたオブジェクトのメンバとして取得されます。

ラスターAdobe PDFはいろいろな保存メソッド(RasterImageFormat.RasPdfXyzフレーバーのどれでも使う)で保存しました、RasterCodecs.GetRasterPdfInfoを用いて得られることができる追加情報を格納します。このメソッドは、以下のようにこれらの追加情報で塗りつぶされるCodecsRasterPdfInfoのインスタンスを返します:

メンバ 説明
IsLeadPdf

ソースファイルがLEADTOOLS PDF Pro、Pro Suite、ドキュメントまたはMedicalproductsで利用できるPDFのサポートで作成されるならば、true;そうでない場合はfalse。このプロパティの値がtrueであるならば、この構造体の他のメンバは的確な情報を格納すると保証されます。このプロパティの値がfalse形式であるかどうかはPDFフレーバーの1つです(RasterImageFormat.RasPdfXyz、そしてソースファイルは、LEADTOOLSで作成されないPDFです、そして、この構造体の他のメンバは、的確な情報(高さXResolutionYResolutionを除いて)を格納すると保証されないかもしれません。このプロパティがtrueであるならば、RasterCodecs.DeletePageを呼び出すことはこのファイルで機能すると保証されます。

BitsPerPixel

ラスターPDFページのピクセル当たりビット値。これは、このファイルを作成するのに用いられるRasterCodecs.SaveメソッドへのbitsPerPixelパラメーター値と同じ使われる値です。それが保存されたオリジナルのピクセル当たりビット値におけるPDFページをロードするために、CodecsPdfLoadOptions.DisplayDepthの値をこの値に設定します。

形式

ラスターPDFページ(RasterImageFormat.RasPdfXyz.の1つ)の形式(圧縮型)これは、このファイルを作成するのに用いられるRasterCodecs.Saveメソッドへの形式パラメーター値と同じ使われる値です。

ページ読込みピクセルの幅。これは、このファイルを作成するのに用いられるRasterCodecs.SaveメソッドへのRasterImageオブジェクトの同じ幅です。

高さ

ページ読込みピクセルの高さ。これは、このファイルを作成するのに用いられるRasterCodecs.SaveメソッドへのRasterImageオブジェクトの同じ高さです。

XResolution

ページ読込みドット/インチの水平解像度。CodecsPdfSaveOptions.UseImageResolutiontrueに設定されるならば、これはこのファイルを作成するのに用いられるRasterCodecs.SaveメソッドへのRasterImageオブジェクトの同じ水平解像度です。

YResolution

ページ読込みドット/インチの垂直解像度。これは、このファイルを作成するのに用いられるRasterCodecs.SaveメソッドへのRasterImageオブジェクトの同じ垂直解像度です。CodecsPdfSaveOptions.UseImageResolutionは、trueに設定されましたかどうか。

バージョン

PDFファイルのバージョン。これは、RasterCodecs.Saveメソッドでこのファイルを保存するときCodecsPdfSaveOptions.Versionが使ったのと同じ値です。

サンプル

このサンプルはそれ自身のサイズ、圧縮とビット/ピクセルがある各々のページで複数ページのラスターPDFファイルを作成して、そしてオリジナルの圧縮、サイズ、直接ファイルから得られる寸法で保存される各々のページで数ページにこのファイルを分割するために、CodecsRasterPdfInfoを使います。

Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing
Imports Leadtools.ImageProcessing.Color
Imports Leadtools.Drawing
Imports Leadtools.Svg

Private Shared Sub CodecsRasterPdfInfoExample()
   Dim multiPageRasterPdfFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "MultiPageRasterPdf.pdf")
   Dim pagesPdfFileNames As String = Path.Combine(LEAD_VARS.ImagesDir, "Page{0}.pdf")
   ' Create a 4 pages PDF file
   CreateMultiPageRasterPdfFile(multiPageRasterPdfFileName)

   ' Without prior information, we will split this multi-page PDF file into
   ' multiple single page PDF files with original size, resolution, bit-depth and compression
   Using codecs As New RasterCodecs()
      Dim pagesSaved As Integer = 0

      ' Get the file information
      Using imageInfo As CodecsImageInfo = codecs.GetInformation(multiPageRasterPdfFileName, True)
         Console.WriteLine( _
            "Information: Format:\n Format: {0}\n Pages: {1}\n Bits/Pixel: {2}\n Size: {3} by {4}\n Resolution: {5} by {6}", _
            imageInfo.Format, imageInfo.TotalPages, imageInfo.BitsPerPixel, imageInfo.Width, imageInfo.Height, imageInfo.XResolution, imageInfo.YResolution)
         Console.WriteLine("-----------------------")

         ' Now show the PDF specific information
         ' Notice: GetInformation will return RasPdf as the format for all PDF files
         ' regardless of the actual compression
         If imageInfo.Format = RasterImageFormat.RasPdf Then
            Console.WriteLine("Image is PDF, getting the specific info for each page")

            For i As Integer = 0 To imageInfo.TotalPages - 1
               Dim pageNumber As Integer = i + 1

               Dim pdfInfo As CodecsRasterPdfInfo = codecs.GetRasterPdfInfo(multiPageRasterPdfFileName, i + 1)
               If pageNumber = 1 Then
                  Console.WriteLine(" LEAD PDF?: {0}", pdfInfo.IsLeadPdf)
                  Console.WriteLine(" Version: {0}", pdfInfo.Version)
               End If

               If pdfInfo.IsLeadPdf Then
                  Console.WriteLine( _
                     "Page {0} of {1} info:\n Bits/Pixel: {2}\n Size: {3} by {4}\n Resolution: {5} by {6}\n Format: {7}", _
                     pageNumber, imageInfo.TotalPages, pdfInfo.BitsPerPixel, pdfInfo.Width, pdfInfo.Height, pdfInfo.XResolution, pdfInfo.YResolution, pdfInfo.Format)
                  Console.WriteLine("-----------------------")

                  ' Load this page with its original parameters
                  codecs.Options.RasterizeDocument.Load.XResolution = pdfInfo.XResolution
                  codecs.Options.RasterizeDocument.Load.YResolution = pdfInfo.YResolution
                  codecs.Options.Pdf.Load.DisplayDepth = pdfInfo.BitsPerPixel

                  Using pageImage As RasterImage = codecs.Load(multiPageRasterPdfFileName, 0, CodecsLoadByteOrder.BgrOrGray, pageNumber, pageNumber)
                     Console.WriteLine( _
                        "Page {0} of {1} loaded:\n Bits/Pixel: {2}\n Size: {3} by {4}\n Resolution: {5} by {6}", _
                        pageNumber, imageInfo.TotalPages, pageImage.BitsPerPixel, pageImage.Width, pageImage.Height, pageImage.XResolution, pageImage.YResolution)
                     Console.WriteLine("-----------------------")

                     ' Setup the PDF save options
                     codecs.Options.Pdf.Save.UseImageResolution = True
                     codecs.Options.Pdf.Save.Version = pdfInfo.Version

                     ' Save this page to a separate file
                     Dim pagePdfFileName As String = String.Format(pagesPdfFileNames, pageNumber)
                     codecs.Save(pageImage, pagePdfFileName, pdfInfo.Format, pdfInfo.BitsPerPixel)
                     pagesSaved = pagesSaved + 1
                  End Using
               End If
            Next
         End If
      End Using

      ' We are done, now show the info of the generated files
      For i As Integer = 0 To pagesSaved - 1
         Dim pageNumber As Integer = i + 1
         Dim pagePdfFileName As String = String.Format(pagesPdfFileNames, pageNumber)

         Dim pdfInfo As CodecsRasterPdfInfo = codecs.GetRasterPdfInfo(pagePdfFileName, 1)
         Console.WriteLine( _
            "Page {0} of {1} info:\n Bits/Pixel: {2}\n Size: {3} by {4}\n Resolution: {5} by {6}\n Format: {7}", _
            pageNumber, pagesSaved, pdfInfo.BitsPerPixel, pdfInfo.Width, pdfInfo.Height, pdfInfo.XResolution, pdfInfo.YResolution, pdfInfo.Format)
         Console.WriteLine("-----------------------")
      Next
   End Using
End Sub

Private Shared Sub CreateMultiPageRasterPdfFile(ByVal pdfFileName As String)
   Dim sourceFile As String = Path.Combine(LEAD_VARS.ImagesDir, "Sample1.cmp")

   ' Delete the destination PDF file if exists
   If System.IO.File.Exists(pdfFileName) Then
      System.IO.File.Delete(pdfFileName)
   End If

   Using codecs As New RasterCodecs()
      ' Save to PDF v1.4
      codecs.Options.Pdf.Save.Version = CodecsRasterPdfVersion.V14
      ' Save using image resolution
      codecs.Options.Pdf.Save.UseImageResolution = True

      ' Load the source file to use for each page
      Using pageImage As RasterImage = codecs.Load(sourceFile, 0, CodecsLoadByteOrder.BgrOrGray, 1, 1)
         Console.WriteLine( _
            "Original image dimension:\n Size: {0} by {1}\n Resolution: {2} by {3}", _
            pageImage.Width, pageImage.Height, pageImage.XResolution, pageImage.YResolution)

         ' Array of bits/pixel and compression to use when saving the pages
         Dim bitsPerPixel() As Integer = _
         { _
            1, _
            8, _
            24 _
         }
         Dim formats() As RasterImageFormat = _
         { _
            RasterImageFormat.RasPdfG4, _
            RasterImageFormat.RasPdfLzw, _
            RasterImageFormat.RasPdfJpeg422 _
         }

         Dim pageCount As Integer = bitsPerPixel.Length
         For i As Integer = 0 To pageCount - 1
            ' Append this page with given format
            Console.WriteLine("Saving page {0} of {1} using {2} at {3}", i + 1, pageCount, bitsPerPixel(i), formats(i))
            codecs.Save(pageImage, pdfFileName, formats(i), bitsPerPixel(i), 1, 1, -1, CodecsSavePageMode.Append)
         Next
      End Using

      Console.WriteLine("-----------------------")
   End Using
End Sub

Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Color;
using Leadtools.Svg;

private static void CodecsRasterPdfInfoExample()
{
   string multiPageRasterPdfFileName = Path.Combine(LEAD_VARS.ImagesDir, "MultiPageRasterPdf.pdf");
   string pagesPdfFileNames = Path.Combine(LEAD_VARS.ImagesDir, "Page{0}.pdf");
   // Create a 4 pages PDF file
   CreateMultiPageRasterPdfFile(multiPageRasterPdfFileName);

   // Without prior information, we will split this multi-page PDF file into
   // multiple single page PDF files with original size, resolution, bit-depth and compression
   using (RasterCodecs codecs = new RasterCodecs())
   {
      int pagesSaved = 0;

      // Get the file information
      using (CodecsImageInfo imageInfo = codecs.GetInformation(multiPageRasterPdfFileName, true))
      {
         Console.WriteLine(
            "Information: Format:\n Format: {0}\n Pages: {1}\n Bits/Pixel: {2}\n Size: {3} by {4}\n Resolution: {5} by {6}",
            imageInfo.Format, imageInfo.TotalPages, imageInfo.BitsPerPixel, imageInfo.Width, imageInfo.Height, imageInfo.XResolution, imageInfo.YResolution);
         Console.WriteLine("-----------------------");

         // Now show the PDF specific information
         // Notice: GetInformation will return RasPdf as the format for all PDF files
         // regardless of the actual compression
         if (imageInfo.Format == RasterImageFormat.RasPdf)
         {
            Console.WriteLine("Image is PDF, getting the specific info for each page");

            for (int i = 0; i < imageInfo.TotalPages; i++)
            {
               int pageNumber = i + 1;

               CodecsRasterPdfInfo pdfInfo = codecs.GetRasterPdfInfo(multiPageRasterPdfFileName, i + 1);
               if (pageNumber == 1)
               {
                  Console.WriteLine(" LEAD PDF?: {0}", pdfInfo.IsLeadPdf);
                  Console.WriteLine(" Version: {0}", pdfInfo.Version);
               }

               if (pdfInfo.IsLeadPdf)
               {
                  Console.WriteLine(
                     "Page {0} of {1} info:\n Bits/Pixel: {2}\n Size: {3} by {4}\n Resolution: {5} by {6}\n Format: {7}",
                     pageNumber, imageInfo.TotalPages, pdfInfo.BitsPerPixel, pdfInfo.Width, pdfInfo.Height, pdfInfo.XResolution, pdfInfo.YResolution, pdfInfo.Format);
                  Console.WriteLine("-----------------------");

                  // Load this page with its original parameters
                  codecs.Options.RasterizeDocument.Load.XResolution = pdfInfo.XResolution;
                  codecs.Options.RasterizeDocument.Load.YResolution = pdfInfo.YResolution;
                  codecs.Options.Pdf.Load.DisplayDepth = pdfInfo.BitsPerPixel;

                  using (RasterImage pageImage = codecs.Load(multiPageRasterPdfFileName, 0, CodecsLoadByteOrder.BgrOrGray, pageNumber, pageNumber))
                  {
                     Console.WriteLine(
                        "Page {0} of {1} loaded:\n Bits/Pixel: {2}\n Size: {3} by {4}\n Resolution: {5} by {6}",
                        pageNumber, imageInfo.TotalPages, pageImage.BitsPerPixel, pageImage.Width, pageImage.Height, pageImage.XResolution, pageImage.YResolution);
                     Console.WriteLine("-----------------------");

                     // Setup the PDF save options
                     codecs.Options.Pdf.Save.UseImageResolution = true;
                     codecs.Options.Pdf.Save.Version = pdfInfo.Version;

                     // Save this page to a separate file
                     string pagePdfFileName = string.Format(pagesPdfFileNames, pageNumber);
                     codecs.Save(pageImage, pagePdfFileName, pdfInfo.Format, pdfInfo.BitsPerPixel);
                     pagesSaved++;
                  }
               }
            }
         }
      }

      // We are done, now show the info of the generated files
      for (int i = 0; i < pagesSaved; i++)
      {
         int pageNumber = i + 1;
         string pagePdfFileName = string.Format(pagesPdfFileNames, pageNumber);

         CodecsRasterPdfInfo pdfInfo = codecs.GetRasterPdfInfo(pagePdfFileName, 1);
         Console.WriteLine(
            "Page {0} of {1} info:\n Bits/Pixel: {2}\n Size: {3} by {4}\n Resolution: {5} by {6}\n Format: {7}",
            pageNumber, pagesSaved, pdfInfo.BitsPerPixel, pdfInfo.Width, pdfInfo.Height, pdfInfo.XResolution, pdfInfo.YResolution, pdfInfo.Format);
         Console.WriteLine("-----------------------");
      }
   }
}

private static void CreateMultiPageRasterPdfFile(string pdfFileName)
{
   string sourceFile = Path.Combine(LEAD_VARS.ImagesDir, "Sample1.cmp");

   // Delete the destination PDF file if exists
   if (System.IO.File.Exists(pdfFileName))
   {
      System.IO.File.Delete(pdfFileName);
   }

   using (RasterCodecs codecs = new RasterCodecs())
   {
      // Save to PDF v1.4
      codecs.Options.Pdf.Save.Version = CodecsRasterPdfVersion.V14;
      // Save using image resolution
      codecs.Options.Pdf.Save.UseImageResolution = true;

      // Load the source file to use for each page
      using (RasterImage pageImage = codecs.Load(sourceFile, 0, CodecsLoadByteOrder.BgrOrGray, 1, 1))
      {
         Console.WriteLine(
            "Original image dimension:\n Size: {0} by {1}\n Resolution: {2} by {3}",
            pageImage.Width, pageImage.Height, pageImage.XResolution, pageImage.YResolution);

         // Array of bits/pixel and compression to use when saving the pages
         int[] bitsPerPixel =
         {
            1,
            8,
            24
         };
         RasterImageFormat[] formats =
         {
            RasterImageFormat.RasPdfG4,
            RasterImageFormat.RasPdfLzw,
            RasterImageFormat.RasPdfJpeg422
         };

         int pageCount = bitsPerPixel.Length;
         for (int i = 0; i < pageCount; i++)
         {
            // Append this page with given format
            Console.WriteLine("Saving page {0} of {1} using {2} at {3}", i + 1, pageCount, bitsPerPixel[i], formats[i]);
            codecs.Save(pageImage, pdfFileName, formats[i], bitsPerPixel[i], 1, 1, -1, CodecsSavePageMode.Append);
         }
      }

      Console.WriteLine("-----------------------");
   }
}

static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Color;

      
public async Task CodecsRasterPdfInfoExample()
{
   string multiPageRasterPdfFileName = @"MultiPageRasterPdf.pdf";
   string pagesPdfFileNames = "Page{0}.pdf";
   try
   {
      // Create a 4 pages PDF file
      await CreateMultiPageRasterPdfFile(multiPageRasterPdfFileName);

      // Without prior information, we will split this multi-page PDF file into
      // multiple single page PDF files with original size, resolution, bit-depth and compression
      using (RasterCodecs codecs = new RasterCodecs())
      {
         int pagesSaved = 0;

         // Get the file information
         StorageFile loadFile = await Tools.AppLocalFolder.GetFileAsync(multiPageRasterPdfFileName);
         using (CodecsImageInfo imageInfo = await codecs.GetInformationAsync(LeadStreamFactory.Create(loadFile), true, 1))
         {
            Debug.WriteLine(
               "Information: Format:\n Format: {0}\n Pages: {1}\n Bits/Pixel: {2}\n Size: {3} by {4}\n Resolution: {5} by {6}",
               imageInfo.Format, imageInfo.TotalPages, imageInfo.BitsPerPixel, imageInfo.Width, imageInfo.Height, imageInfo.XResolution, imageInfo.YResolution);
            Debug.WriteLine("-----------------------");

            // Now show the PDF specific information
            // Notice: GetInformation will return RasPdf as the format for all PDF files
            // regardless of the actual compression
            if (imageInfo.Format == RasterImageFormat.RasPdf)
            {
               Debug.WriteLine("Image is PDF, getting the specific info for each page");

               for (int i = 0; i < imageInfo.TotalPages; i++)
               {
                  int pageNumber = i + 1;

                  CodecsRasterPdfInfo pdfInfo = await codecs.GetRasterPdfInfoAsync(LeadStreamFactory.Create(loadFile), i + 1);
                  if (pageNumber == 1)
                  {
                     Debug.WriteLine(" LEAD PDF?: {0}", pdfInfo.IsLeadPdf);
                     Debug.WriteLine(" Version: {0}", pdfInfo.Version);
                  }

                  if (pdfInfo.IsLeadPdf)
                  {
                     Debug.WriteLine(
                        "Page {0} of {1} info:\n Bits/Pixel: {2}\n Size: {3} by {4}\n Resolution: {5} by {6}\n Format: {7}",
                        pageNumber, imageInfo.TotalPages, pdfInfo.BitsPerPixel, pdfInfo.Width, pdfInfo.Height, pdfInfo.XResolution, pdfInfo.YResolution, pdfInfo.Format);
                     Debug.WriteLine("-----------------------");

                     // Load this page with its original parameters
                     codecs.Options.RasterizeDocument.Load.XResolution = pdfInfo.XResolution;
                     codecs.Options.RasterizeDocument.Load.YResolution = pdfInfo.YResolution;
                     codecs.Options.Pdf.Load.DisplayDepth = pdfInfo.BitsPerPixel;

                     using (RasterImage pageImage = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile), 0, CodecsLoadByteOrder.BgrOrGray, pageNumber, pageNumber))
                     {
                        Debug.WriteLine(
                           "Page {0} of {1} loaded:\n Bits/Pixel: {2}\n Size: {3} by {4}\n Resolution: {5} by {6}",
                           pageNumber, imageInfo.TotalPages, pageImage.BitsPerPixel, pageImage.Width, pageImage.Height, pageImage.XResolution, pageImage.YResolution);
                        Debug.WriteLine("-----------------------");

                        // Setup the PDF save options
                        codecs.Options.Pdf.Save.UseImageResolution = true;
                        codecs.Options.Pdf.Save.Version = pdfInfo.Version;

                        // Save this page to a separate file
                        string pagePdfFileName = string.Format(pagesPdfFileNames, pageNumber);
                        StorageFile saveFile = await Tools.AppLocalFolder.CreateFileAsync(pagePdfFileName);
                        await codecs.SaveAsync(pageImage, LeadStreamFactory.Create(saveFile), pdfInfo.Format, pdfInfo.BitsPerPixel);
                        pagesSaved++;
                     }
                  }
               }
            }
         }

         // We are done, now show the info of the generated files
         for (int i = 0; i < pagesSaved; i++)
         {
            int pageNumber = i + 1;
            string pagePdfFileName = string.Format(pagesPdfFileNames, pageNumber);

            StorageFile saveFile = await Tools.AppLocalFolder.GetFileAsync(pagePdfFileName);
            CodecsRasterPdfInfo pdfInfo = await codecs.GetRasterPdfInfoAsync(LeadStreamFactory.Create(saveFile), 1);
            Debug.WriteLine(
               "Page {0} of {1} info:\n Bits/Pixel: {2}\n Size: {3} by {4}\n Resolution: {5} by {6}\n Format: {7}",
               pageNumber, pagesSaved, pdfInfo.BitsPerPixel, pdfInfo.Width, pdfInfo.Height, pdfInfo.XResolution, pdfInfo.YResolution, pdfInfo.Format);
            Debug.WriteLine("-----------------------");
         }
      }
   }
   catch (Exception ex)
   {
      string error="";
      RasterException rasterException = RasterException.FromHResult(ex.HResult);
      if (rasterException != null)
         error = rasterException.Message;
      else
         error = ex.Message;
      Debug.WriteLine(error);
      Assert.Fail(error);
   }
}

public async Task CreateMultiPageRasterPdfFile(string pdfFileName)
{
   string sourceFile = @"Assets\Image1.cmp";

   using (RasterCodecs codecs = new RasterCodecs())
   {
      // Save to PDF v1.4
      codecs.Options.Pdf.Save.Version = CodecsRasterPdfVersion.V14;
      // Save using image resolution
      codecs.Options.Pdf.Save.UseImageResolution = true;

      // Load the source file to use for each page
      StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(sourceFile);
      using (RasterImage pageImage = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile), 0, CodecsLoadByteOrder.BgrOrGray, 1, 1))
      {
         Debug.WriteLine(
            "Original image dimension:\n Size: {0} by {1}\n Resolution: {2} by {3}",
            pageImage.Width, pageImage.Height, pageImage.XResolution, pageImage.YResolution);

         // Array of bits/pixel and compression to use when saving the pages
         int[] bitsPerPixel =
           {
              1,
              8,
              24
           };
         RasterImageFormat[] formats =
           {
              RasterImageFormat.RasPdfG4,
              RasterImageFormat.RasPdfLzw,
              RasterImageFormat.RasPdfJpeg422
           };

         int pageCount = bitsPerPixel.Length;
         StorageFile saveFile = await Tools.AppLocalFolder.CreateFileAsync(pdfFileName);
         ILeadStream stream = LeadStreamFactory.Create(saveFile);
         for (int i = 0; i < pageCount; i++)
         {
            // Append this page with given format
            Debug.WriteLine("Saving page {0} of {1} using {2} at {3}", i + 1, pageCount, bitsPerPixel[i], formats[i]);
            await codecs.SaveAsync(pageImage, stream, formats[i], bitsPerPixel[i], 1, 1, -1, CodecsSavePageMode.Append);
         }
      }

      Debug.WriteLine("-----------------------");
   }
}
必要条件

ターゲットプラットホーム

参照

参照

CodecsRasterPdfInfoメンバ
Leadtools.Codecs名前空間
PDF機能の実装