Leadtools.Pdfアセンブリ > Leadtools.Pdf名前空間 > PDFFileクラス :Distillメソッド |
public void Distill( PDFDistillerOptions distillerOptions, string destinationFileName )
'Declaration
Public Sub Distill( _ ByVal distillerOptions As PDFDistillerOptions, _ ByVal destinationFileName As String _ )
'Usage
Dim instance As PDFFile Dim distillerOptions As PDFDistillerOptions Dim destinationFileName As String instance.Distill(distillerOptions, destinationFileName)
public: void Distill( PDFDistillerOptions^ distillerOptions, String^ destinationFileName )
このメソッドを使うために、有効なPostScriptファイルでこのPDFFileオブジェクトを関連付けます。PDFFile(string fileName)コンストラクタを用いてどちらによってでもこれを達成することができるか、ファイル名を設定することができます、そして、直接FileNameプロパティに。注意:ファイルがPostScriptであるため、このメソッドを使う前に、ロードを呼び出しません。
このメソッドは、デスティネーションPDFファイルを作成するこのPDFFileオブジェクトの以下のプロパティを使います:
DocumentProperties.このプロパティの値がnullであるならば、デフォルトのプロパティが使われます
SecurityOptions.このプロパティの値がnullでないならば、行き先ファイルはこのプロパティのプロパティを使用して暗号化されます。このプロパティの値がnullであるならば、得られるファイルは暗号化されません。
CompatibilityLevel.生成されるファイルのPDFバージョン。
このサンプルは、PostScriptファイルからPDFファイルを(蒸留する)作成します。
Imports Leadtools Imports Leadtools.Codecs Imports Leadtools.Pdf Imports Leadtools.WinForms Imports Leadtools.Svg Imports Leadtools.ImageProcessing <TestMethod> _ Public Sub PDFFileDistillExample() Dim sourceFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "LEAD.ps") Dim destinationFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "LEAD_ps.pdf") ' Set the source PS file Dim file As PDFFile = New PDFFile(sourceFileName) ' Setup the distill options, eBook optimized Dim options As PDFDistillerOptions = New PDFDistillerOptions() options.AutoRotatePageMode = PDFDistillerAutoRotatePageMode.PageByPage options.OutputMode = PDFDistillerOutputMode.EBookOptimized file.Distill(options, destinationFileName) 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.Controls; using Leadtools.Drawing; using Leadtools.ImageProcessing; using Leadtools.Pdf; using Leadtools.Svg; using Leadtools.WinForms; [TestMethod] public void PDFFileDistillExample() { string sourceFileName = Path.Combine(LEAD_VARS.ImagesDir, @"LEAD.ps"); string destinationFileName = Path.Combine(LEAD_VARS.ImagesDir, @"LEAD_ps.pdf"); // Set the source PS file PDFFile file = new PDFFile(sourceFileName); // Setup the distill options, eBook optimized PDFDistillerOptions options = new PDFDistillerOptions(); options.AutoRotatePageMode = PDFDistillerAutoRotatePageMode.PageByPage; options.OutputMode = PDFDistillerOutputMode.EBookOptimized; file.Distill(options, destinationFileName); } static class LEAD_VARS { public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; }