Convert DICOM to PDF using C#

[ ]

DICOM format is the medical industry standard for the creation, storage, transmission, and visualization of digital medical images and documents of examined patients.

Aspsoe.PDF for .NET allows you to convert DICOM and SVG images, but for technical reasons to add images you need to specify the type of file to be added to PDF:

  1. Create an object of the Image class.
  2. Add the image to a page’s Paragraphs collection.
  3. Specify the FileType property.
  4. Specify the file’s path or source.
    • If an image is at a location on the hard drive, specify the path location using the Image.File property.
    • If an image is placed in a MemoryStream, pass the object holding the image to the Image.ImageStream property.

The following code snippet shows how to convert DICOM files to PDF format with Aspose.PDF. You should load DICOM image, place the image on a page in a PDF file and save the output as PDF.

private const string _dataDir = "..\\..\\..\\..\\Samples";
// Convert DICOM images to PDF using Image class
public static void ConvertDICOMtoPDF()
    // Instantiate Document Object
    Document pdfDocument = new Document();

    // Add a page to pages collection of document
    Page page = pdfDocument.Pages.Add();

    Image image = new Image
        FileType = ImageFileType.Dicom,
        File = System.IO.Path.Combine(_dataDir,"bmode.dcm")
    // Save output as PDF format