We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to Convert All Pages of a PDF to PPT where each pdf page comes as images

Convert All Pages of a PDF to PPT where each pdf page comes as images instead of selectable text in the PPT

Hi there,


Thanks for your inquriy. I am afraid currently Aspose.Pdf does not render text data as image in PDF to PPTX conversion. We have logged an enhancement ticket PDFNET-42286 in our issue tracking system for the requirement. We will keep you updated about the issue resolution progress within this forum thread.

Furthermore as a workaround, you can convert PDF pages to images, create a new PDF from the images and finally convert that PDF document to PPTX. Please check following sample code snippet. Hopefully it will help you to accomplish the task.

// Open document<o:p></o:p>

Aspose.Pdf.Document doc = new Aspose.Pdf.Document("test.pdf");

Aspose.Pdf.Document doc1 = new Aspose.Pdf.Document();

for (int pageCount = 1; pageCount <= doc.Pages.Count; pageCount++)

{

MemoryStream imageStream = new MemoryStream();

Page page=doc1.Pages.Add();

// Create PNG device with specified attributes

// Width, Height, Resolution, Quality

// Quality [0-100], 100 is Maximum

// Create Resolution object

Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(300);

PngDevice pngDevice = new PngDevice(resolution);

// Convert a particular page and save the image to stream

pngDevice.Process(doc.Pages[pageCount], imageStream);

Aspose.Pdf.Image image = new Aspose.Pdf.Image();

image.ImageStream = imageStream;

page.Paragraphs.Add(image);

}

MemoryStream ms = new MemoryStream();

doc1.Save(ms);

doc1 = new Aspose.Pdf.Document(ms);

// Instantiate PptxSaveOptions instance

Aspose.Pdf.PptxSaveOptions pptx_save = new Aspose.Pdf.PptxSaveOptions();

// Save the output in PPTX format

doc1.Save("PDFToPPT_out_.pptx", pptx_save);


Please feel free to contact us for any further assistance.

Best Regards,

@smssms666,

Thanks for your patience.

We are pleased to share that the feature to render text of PDF file as Image in resultant PPT file has been implemented in recent release of Aspose.Pdf for .NET 17.9. Please try using the latest release with following code snippet.

[C#]

Aspose.Pdf.Document doc = new Aspose.Pdf.Document("HelloWorld.pdf));
// Instantiate PptxSaveOptions instance
Aspose.Pdf.PptxSaveOptions pptx_save = new Aspose.Pdf.PptxSaveOptions();
// Save the output in PPTX format
pptx_save.SlidesAsImages = true;
doc.Save("PDFToPPT_out_.pptx", pptx_save);
1 Like