Preflighting PDFs

We need to do some basic pre-flighting of PDFs.

The requirements are to check for:

Non-embedded fonts
Low resolution images
Images in RGB color space

We are already using Adobe PDF.NET and it would be great to use features in this tool. Is this something that can be done?

pdf pre-flight (for the search engines)

Hi Dan,

Thanks for contacting support.

In order to check the Non-Embedded fonts inside PDF file, you need to traverse through all TextSegment inside PDF file and get the formatting information related to each segment. For more information, please visit Search and Get Text Segments from All Pages of PDF Document

Now concerning to images, please follow the instructions specified over Get the Resolution and Dimensions of Embedded Images and Identify if image inside PDF is Colored or Black & White

Should you have any further query, please feel free to contact.

Thank you, this is helpful.

The last requirement “check for images in RGB color space” is meant to validate that all images are in the CMYK color space. I’ve checked the enum in that code example, and it doesn’t have a value for CMYK. Is there a way to check that all images in the pdf are in CMYK?

Hi Dan,

Yes you are correct. Currently the enumeration do not provide the feature to determine if the extracted image is CMYK colorspace or not. However I am working on find some related solution and will get back to you soon.

Hi Dan,

Thanks for your patience.

In order to accomplish this requirement, you need to first extract images from PDF file and then determine the color space of image using Aspose.Imaging. Please follow the steps to Extract Images from the PDF File and then try using following code snippet to determine the color space of image file.

[C#]

String path = @"C:\pdftest\";
// load input image file
using (Aspose.Imaging.FileFormats.Jpeg.JpegImage jpgImage = (Aspose.Imaging.FileFormats.Jpeg.JpegImage)Aspose.Imaging.Image.Load(path + "CMYK_image_file.jpg"))
{
    // print Height, Width and PixelFormat of loaded image
    Console.WriteLine("Height: {0}, Width: {1}, Color Profile: {2}", jpgImage.Height, jpgImage.Width, jpgImage.RawDataFormat.PixelFormat);
}

Regards,
Nayyer Shahbaz

Great, thank you. We will give that a shot.