Insert Image in Word DOCX Document & Convert to PDF using CMYK Color Space using C# .NET | RGB to CMYK

We are inserting a photo and are saving the document as PDF … for printing.

How do we convert the photo to CMYK so we do not have color shift at the printers? Here is our code.

        System.Drawing.Image foto = System.Drawing.Image.FromFile(photoPath);
        double fotoWidth = ConvertUtil.PixelToPoint(foto.Width, foto.HorizontalResolution);
        double fotoHeight = ConvertUtil.PixelToPoint(foto.Height, foto.VerticalResolution);

        double marginLeft = (photoConfig.width - fotoWidth) / 2;
        double left = photoConfig.left + marginLeft;

        Shape coverPhoto = builder.InsertImage(photoPath,
                                RelativeHorizontalPosition.Page, left,
                                RelativeVerticalPosition.Page, photoConfig.top,
                                -1, -1, WrapType.None);

Adobe Acrobat Pro indicates the image is ColorSpace: DeviceRGB.

We are having color Shift issues. Any recommendations would help greatly.

@adventurousbooks,

We have logged your requirement in our issue tracking system. Your ticket number is WORDSNET-19410. We will further look into the details of this requirement and will keep you updated on the status of the linked issue. We apologize for any inconvenience.

@adventurousbooks,

You can convert images in Word document to CMYK color space when saving to PDF by using the PdfImageColorSpaceExportMode.SimpleCmyk. Also, you can use third-party PDF editing tools to convert the Aspose.Words’ PDF output to CMYK. Please try Aspose.PDF for this. Hope, this helps.

PdfSaveOptions opts = new PdfSaveOptions();
opts.ImageColorSpaceExportMode = PdfImageColorSpaceExportMode.SimpleCmyk;
doc.Save("E:\\Temp\\19.10.pdf", opts);

@adventurousbooks,

Regarding WORDSNET-19410, we have completed the work on your issue and concluded to close this issue as ‘Not a Bug’. Please see my previous post for analysis details.