Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Este artículo explica cómo convertir PDF a PowerPoint usando C#. Cubre estos temas.
Formato: PPTX
Formato: PowerPoint
El siguiente fragmento de código también funciona con la biblioteca Aspose.PDF.Drawing.
Aspose.PDF for .NET te permite rastrear el progreso de la conversión de PDF a PPTX.
Tenemos una API llamada Aspose.Slides que ofrece la función de crear y manipular presentaciones PPT/PPTX. Esta API también proporciona la función de convertir archivos PPT/PPTX a formato PDF. Recientemente recibimos solicitudes de muchos de nuestros clientes para apoyar la capacidad de transformación de PDF a formato PPTX. A partir de la versión Aspose.PDF for .NET 10.3.0, hemos introducido una función para transformar documentos PDF a formato PPTX. Durante esta conversión, las páginas individuales del archivo PDF se convierten en diapositivas separadas en el archivo PPTX.
Durante la conversión de PDF a PPTX, el texto se renderiza como texto donde puedes seleccionarlo/actualizarlo. Ten en cuenta que para convertir archivos PDF a formato PPTX, Aspose.PDF proporciona una clase llamada PptxSaveOptions
. Un objeto de la clase PptxSaveOptions se pasa como segundo argumento al Document.Save(..) method
. El siguiente fragmento de código muestra el proceso para convertir archivos PDF a formato PPTX.
Para convertir PDF a PPTX, Aspose.PDF for .NET aconseja usar los siguientes pasos de código.
Pasos: Convertir PDF a PowerPoint en C# | Pasos: Convertir PDF a PPTX en C#
// 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);
}
}
Intenta convertir PDF a PowerPoint en línea
Aspose.PDF for .NET te presenta una aplicación gratuita en línea “PDF a PPTX”, donde puedes investigar la funcionalidad y la calidad con la que funciona.
En caso de que necesites convertir un PDF buscable a PPTX como imágenes en lugar de texto seleccionable, Aspose.PDF proporciona tal función a través de la clase Aspose.Pdf.PptxSaveOptions. Para lograr esto, establece la propiedad SlidesAsImages de la clase PptxSaveOptios en ’true’ como se muestra en el siguiente ejemplo de código.
// 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 te permite rastrear el progreso de la conversión de PDF a PPTX. La clase Aspose.Pdf.PptxSaveOptions proporciona la propiedad CustomProgressHandler que se puede especificar a un método personalizado para rastrear el progreso de la conversión como se muestra en el siguiente ejemplo de código.
// 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;
}
}
Este artículo también cubre estos temas. Los códigos son los mismos que los anteriores.
Formato: PowerPoint
Formato: PPTX
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.