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

Free Support Forum - aspose.com

How I can convert Pdf to images and insert all image into docx file?

I have a docx file and set of PDF files that I need to convert all the PDF files to images and append them to a DOCX file using Aspose.NET word with the same style, order, width, and height.

I need example for above senior
please advice

HI @JassarMahmoud

We have several examples , I will show you two with which you can do what you require

  1. Convert PDF to Images
 public static class ExampleConvertPdfToImage
      private static readonly string _dataDir = @"C:\Samples\";
     // BMP, JPEG, GIF, PNG, EMF
     public static void ConvertPDFusingImageDevice()
         // Create Resolution object            
         Resolution resolution = new Resolution(300);
         BmpDevice bmpDevice = new BmpDevice(resolution);
         JpegDevice jpegDevice = new JpegDevice(resolution);
         GifDevice gifDevice = new GifDevice(resolution);
         PngDevice pngDevice = new PngDevice(resolution);
         EmfDevice emfDevice = new EmfDevice(resolution);
         Document document = new Document(_dataDir + 
         ConvertPDFtoImage(bmpDevice, "bmp", document);
         ConvertPDFtoImage(jpegDevice,"jpeg", document);
         ConvertPDFtoImage(gifDevice, "gif", document);
         ConvertPDFtoImage(pngDevice, "png", document);
         ConvertPDFtoImage(emfDevice, "emf", document);
 public static void ConvertPDFtoImage(ImageDevice imageDevice, 
         string ext, Document pdfDocument)
     for (int pageCount = 1; pageCount <= pdfDocument.Pages.Count; pageCount++)
         using (FileStream imageStream = 
         new FileStream($"{_dataDir}image{pageCount}_out.{ext}", 
             // Convert a particular page and save the image to stream
             imageDevice.Process(pdfDocument.Pages[pageCount], imageStream);
             // Close stream
  1. Load the DOCX file using Aspose.NET WORD

  2. add Images to DOCX

you can use API reference for change or mantain same style in document

hope that help