Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
この記事では、C#を使用してPDFをPowerPointに変換する方法を説明します。以下のトピックをカバーしています。
形式: PPTX
形式: PowerPoint
以下のコードスニペットは、Aspose.PDF.Drawingライブラリでも動作します。
Aspose.PDF for .NETを使用すると、PDFからPPTXへの変換の進捗を追跡できます。
私たちには、PPT/PPTXプレゼンテーションを作成および操作する機能を提供するAPIであるAspose.Slidesがあります。このAPIは、PPT/PPTXファイルをPDF形式に変換する機能も提供します。最近、多くの顧客からPDFをPPTX形式に変換する機能をサポートする要求を受けました。Aspose.PDF for .NETのリリース10.3.0から、PDFドキュメントをPPTX形式に変換する機能を導入しました。この変換中に、PDFファイルの各ページがPPTXファイルの個別のスライドに変換されます。
PDFからPPTXへの変換中に、テキストは選択/更新可能なテキストとしてレンダリングされます。PDFファイルをPPTX形式に変換するには、Aspose.PDFがPptxSaveOptions
というクラスを提供しています。PptxSaveOptionsクラスのオブジェクトは、Document.Save(..) method
の第2引数として渡されます。以下のコードスニペットは、PDFファイルをPPTX形式に変換するプロセスを示しています。
PDFをPPTXに変換するには、Aspose.PDF for .NETは以下のコードステップを使用することをお勧めします。
手順: C#でPDFをPowerPointに変換する | 手順: C#でPDFをPPTXに変換する
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ConvertPDFToPPTX()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf();
// Open PDF document
using (var document = new Aspose.Pdf.Document(dataDir + "input.pdf"))
{
// Instantiate PptxSaveOptions object
var saveOptions = new Aspose.Pdf.PptxSaveOptions();
// Save the file in PPTX format
document.Save(dataDir + "PDFToPPT_out.pptx", saveOptions);
}
}
PDFをPowerPointにオンラインで変換してみてください
Aspose.PDF for .NETは、オンラインの無料アプリケーション“PDF to PPTX”を提供しており、機能と品質を調査することができます。
検索可能なPDFを選択可能なテキストの代わりに画像としてPPTXに変換する必要がある場合、Aspose.PDFはその機能をAspose.Pdf.PptxSaveOptionsクラスを介して提供します。これを実現するには、PptxSaveOptionsクラスのプロパティSlidesAsImagesを’true’に設定します。以下のコードサンプルに示すように。
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ConvertPDFToPPTWithSlidesAsImages()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf();
// Open PDF document
using (var document = new Aspose.Pdf.Document(dataDir + "input.pdf"))
{
// Instantiate PptxSaveOptions object
var saveOptions = new Aspose.Pdf.PptxSaveOptions
{
SlidesAsImages = true
};
// Save the file in PPTX format with slides as images
document.Save(dataDir + "PDFToPPT_out.pptx", saveOptions);
}
}
Aspose.PDF for .NETは、PDFからPPTXへの変換の進捗を追跡できます。Aspose.Pdf.PptxSaveOptionsクラスは、変換の進捗を追跡するためにカスタムメソッドを指定できるCustomProgressHandlerプロパティを提供します。以下のコードサンプルに示すように。
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ConvertPDFToPPTWithCustomProgressHandler()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf();
// Open PDF document
using (var document = new Aspose.Pdf.Document(dataDir + "input.pdf"))
{
// Instantiate PptxSaveOptions object
var saveOptions = new Aspose.Pdf.PptxSaveOptions();
// Specify custom progress handler
saveOptions.CustomProgressHandler = ShowProgressOnConsole;
// Save the file in PPTX format with progress tracking
document.Save(dataDir + "PDFToPPTWithProgressTracking_out.pptx", saveOptions);
}
}
// Define the method to handle progress events and display them on the console
private static void ShowProgressOnConsole(Aspose.Pdf.UnifiedSaveOptions.ProgressEventHandlerInfo eventInfo)
{
switch (eventInfo.EventType)
{
case Aspose.Pdf.ProgressEventType.TotalProgress:
// Display overall progress of the conversion
Console.WriteLine($"{DateTime.Now.TimeOfDay} - Conversion progress: {eventInfo.Value}%.");
break;
case Aspose.Pdf.ProgressEventType.ResultPageCreated:
// Display progress of the page layout creation
Console.WriteLine($"{DateTime.Now.TimeOfDay} - Result page {eventInfo.Value} of {eventInfo.MaxValue} layout created.");
break;
case Aspose.Pdf.ProgressEventType.ResultPageSaved:
// Display progress of the page being exported
Console.WriteLine($"{DateTime.Now.TimeOfDay} - Result page {eventInfo.Value} of {eventInfo.MaxValue} exported.");
break;
case Aspose.Pdf.ProgressEventType.SourcePageAnalysed:
// Display progress of the source page analysis
Console.WriteLine($"{DateTime.Now.TimeOfDay} - Source page {eventInfo.Value} of {eventInfo.MaxValue} analyzed.");
break;
default:
break;
}
}
この記事では、以下のトピックもカバーしています。コードは上記と同じです。
形式: PowerPoint
形式: PPTX
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.